2

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();
});
1
  • can we see your html as well? Commented Nov 20, 2015 at 9:34

2 Answers 2

2

There is slight mistake in you script

$("#load").on("click", function(){
  tbl.row.add(data).draw();

});

you had it rows instead of row.

Sign up to request clarification or add additional context in comments.

Comments

1

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();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.