【发布时间】:2018-07-27 10:02:52
【问题描述】:
我有一个带有 DataTable、JQuery 的表,我用 php 返回了一个 json,但没有在表的行中添加数据。
var table = $('#list').DataTable();
table.row.add([{"id":"1","name":"other", "action":"edit"}]);
【问题讨论】:
-
1) 您只能将
table.row.add()与对象文字一起使用如果 您已使用columns或columnDefs创建了表定义data索引的部分2)当您插入带有table.row.add()的新行时,您必须 包含alldata中声明的索引上面提到的columns或columnDefs部分
标签: php jquery json datatables