我正在使用AlloyUI 3.0。 我使用了上面的代码:
YUI().use(
'aui-datatable',
function(Y) {
var columns = [
{label: 'ID', key: 'id'},
{label: 'Project Name', key: 'name'},
{label: 'Created At', key: 'created_at'}
],
data = [];
var myDataTable = new Y.DataTable({
plugins: [
{
cfg: {
selectRow: true
},
fn: Y.Plugin.DataTableSelection
},
{
cfg: {
highlightRange: false,
type: 'rows'
},
fn: Y.Plugin.DataTableHighlight
}
],
columns: columns,
data: data
})
.render("#myDataTable");
}
);
如何获取所选行数据? 如何定义选择事件,单击,双击等?
答案 0 :(得分:0)
找到解决方案: var rowUID = DataTable.get('selection')。rows [0] .guid(); DataTable.getRecord(UID).toJSON();