我需要用来自服务器的 json 填充一个表,aaData
and aoColumns
,但问题是我需要一个带有按钮的列。
我有这个代码
$('#divGrid').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>');
var results = result.split('@_@');
$('#example').dataTable({
"aaData": $.parseJSON(results[0]),
,
"aoColumns": $.parseJSON(results[1])
});
}
我的结果是
results[0] = "[["
jpa ","
SI ","
","
","
","
PADILLA ",1],["
sid ","
SI ","
","
","
","
MIRAMONTES ",2]]"
results[1] = [{
"sTitle": "UserName"
}, {
"sTitle": "ID_CENTRO_TRABAJO"
}, {
"sTitle": "rolName"
}, {
"sTitle": "dominio"
}, {
"sTitle": "recibeAlertas"
}, {
"sTitle": "NOMBRE"
}, {
"sTitle": "edit",
"fnRender": 'function(obj){ return ' < input type = 'button'
name = 'hola'
value = 'Play' > < /input>';}'}]"
但我的控制台很干净,没有抛出错误。值出现,但按钮不出现。