Inserting data dynamically

Inserting data dynamically

markusslimamarkusslima Posts: 1Questions: 0Answers: 0
edited January 2015 in Free community support
jsvar table = $('#table').dataTables({
  "columns": [
     {"title": "Col 1", "width": "80%"},
     {"title": "Col 2", "width": "20%"},
  ]
});

$('#btnAddData').click(function () {
   var arr = [
       [1, 2],
       [2, 3]
   ];
   table._fnClearTable();
   table._fnAddData(arr);
   table._fnReDraw(); // or  table._fnDraw();
});

Dont Work

Replies

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Why are you calling the private API methods rather than the public API? If you are going to use the legacy API it is documented here, but you would be best served using the new API in 1.10.

    Allan

This discussion has been closed.