jQuery Datatable Refresh more than one table simultaneously
- Article
- Comment
jQuery Datatable Refresh more than one table simultaneously. There some occasions, we need to redraw more than one datatables together. for that, you can’t simply enter the multi selector to do that operations such as the following example.
$('#selct1,#select2, ..').dataTable().fnDraw();
It won’t work for you. you need to do it each one separately. So we can use jQuery each function to handle it.
var dt_table_id =["#frist_kvcodes" , "#second-kvcodes" , "#third-table" ];
and now for the iterating function.
$.each(dt_table_id, function(index, value){ $(value).dataTable().fnDraw(); });
that’s it. It will take care of the refresh functions. if you have any doubt or problem with this code comment below.