Reputation: 15
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"}]);
Upvotes: 1
Views: 1664
Reputation: 310
I think this line should be work:
table.row.add(['Fiona White', 32, 'Edinburgh']).draw();
Upvotes: 2
Reputation: 174
Try this code:
var table = $('#list').DataTable();
table.row.add([{"id":"1","name":"other", "action":"edit"}]).draw();
Upvotes: 0
Reputation: 2201
Try this
var table = $('#list').DataTable();
table.row.add({"id":"1","name":"other", "action":"edit"}).draw();
Upvotes: 0