我想在DOM
alloyui
中展示dataTable
个元素。但alloyui
表未显示DOM
元素。我的代码如下:
var tableData = [];
this._popupContent.innerHTML = "";
for(var key in this._info){
(function(k) {
var item = {};
item.name = k;
item.dom = document.createElement('a');
item.dom.innerHTML = key;
item.dom.addEventListener("click", function(){
//do something
console.log(k);
});
tableData.push(item);
})(key)
}
YUI().use(
'aui-datatable',
function(Y) {
var columns = [
{ key: 'name',
allowHTML: true
},
{
key: 'dom',
allowHTML: true
}
];
new Y.DataTable({
columnset: columns,
recordset: tableData
}).render('#popupContent');
}
);
有人可以帮助我吗?