reload datatable after ajax success reload datatable after ajax success ajax ajax

reload datatable after ajax success


Get table id first, like:

var table=('#tableid').Datatable();table.draw();

just put these lines after ajax success function to reload datatable


On a button clik you dont need to empty your table body and make initiate the datatable again with the ajax.

you just have to call your ajax again as you have already initiate on document ready function

just use

$("#Table_id").ajax.reload();

check the below link, you will have better idea.

https://datatables.net/reference/api/ajax.reload()

Let me know if this doesn't help you


Use like it

$('#product_table').DataTable().ajax.reload();