简体   繁体   中英

YUI get specific cell value when selecting a row to fire event

I am using Yahoo UI library, in particular this example .

What I want is to get a particular column's value when clicking (selecting) a row.

I am using this code:

var makis = function() {alert("blabla"); };
myDataTable.subscribe("rowClickEvent", makis);

and works, but I just don't know how to get a column's value in the particular row.

Ok i found it on my own, i am posting if anyone has the same problem.

myDataTable.subscribe("rowClickEvent", function(oArgs) {
                                        var elTarget = oArgs.target;
                                        var oRec = this.getRecord(elTarget);
                                        console.log("value:" + oRec.getData("column_we_want"));
                                }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM