RubenLancho
RubenLancho

Reputation: 15

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"}]);

Upvotes: 1

Views: 1664

Answers (3)

Jose
Jose

Reputation: 310

I think this line should be work:

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

Upvotes: 2

Ajay Jangra
Ajay Jangra

Reputation: 174

Try this code:

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

Upvotes: 0

jvk
jvk

Reputation: 2201

Try this

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

Upvotes: 0

Related Questions