我有一个 YUI 数据表如下
YAHOO.example.Data = {
bookorders: [
{id:"po-0167", date:new Date(1980, 2, 24), quantity:1, amount:4, title:"A Book About Nothing"},
{id:"po-0783", date:new Date("January 3, 1983"), quantity:null, amount:12.12345, title:"The Meaning of Life"},
{id:"po-0297", date:new Date(1978, 11, 12), quantity:12, amount:1.25, title:"This Book Was Meant to Be Read Aloud"},
{id:"po-1482", date:new Date("March 11, 1985"), quantity:6, amount:3.5, title:"Read Me Twice"}
]
}
我向它添加了一个订阅事件
myDataTable.subscribe("rowClickEvent", function(args){
alert("inside click1");
var rec = myDataTable.getSelectedRows()[0];
.
.
.
printTitle(record.title);
});
问题是我无法获得选定的行。我有另一个函数 printTitle 来提醒单击该行的书的标题。
我设法使用 myDataTable.getSelectedRows()[0] 获得了 selectedRow。我更新了我的代码,但现在我似乎无法获得标题。