简体   繁体   中英

Add a row DataTable with json

I have a table with DataTable, JQuery, and I return a json with php, but not add data in row of table.

var table = $('#list').DataTable();
table.row.add([{"id":"1","name":"other", "action":"edit"}]);

我认为这行应该可行:

table.row.add(['Fiona White', 32, 'Edinburgh']).draw();

Try this code:

var table = $('#list').DataTable();
table.row.add([{"id":"1","name":"other", "action":"edit"}]).draw();

Try this

var table = $('#list').DataTable();
table.row.add({"id":"1","name":"other", "action":"edit"}).draw();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM