How to refresh Jquery datatables in order to account for newly added rows? -


i json request , fill table in dom rows , call .datatable() make datable. instead of ajax call various reasons.

now want add rows table (by manipulating dom , adding rows manually). how can 'refresh' or 'reload' datatables account these new rows?

thanks!

when need reinitalise datatable, use destroy() method. re-initialise normal.

var table = $("#table").datatable();  // table updated  addrow();  // destroy outdated table table.destroy();  // create new instance of datatables table = $("#table").datatable(); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -