Reputation: 6330
Can you please take a look at This Demo and let me know why I am not able to load the data from the array into the DataTable instance correctly?
Here is the code which I have:
var data = [ "Dai Rios", "Personnel Lead", "Edinburgh", "2290", "2012/09/26", "$217,500" ];
var tbl = $('#example').DataTable();
$("#load").on("click", function(){
tbl.rows.add(data).draw();
});
Upvotes: 2
Views: 58
Reputation: 666
There is slight mistake in you script
$("#load").on("click", function(){
tbl.row.add(data).draw();
});
you had it rows
instead of row
.
Upvotes: 2
Reputation: 875
instead of "rows" in tbl.rows.add(data).draw();
use "row" i.e.
instead of
tbl.rows.add(data).draw();
use
tbl.row.add(data).draw();
Upvotes: 1