How to refresh a DOM-based datatable after changing it's content via ajax?
How to refresh a DOM-based datatable after changing it's content via ajax?
TheGuy
Posts: 2Questions: 1Answers: 0
Hi guys,
I have a DOM-based datatable and I am using the data-order="*" tag to enable custom sorting.
The data (especially the data-order="*") tag can change and my problem is that right now the new DOM-data is not consired. I need a way to refresh the table.
I have tried .clear().draw() and fnDraw() with NO sucess.
Do you guys know a solution for this?
Kind regards
Steven
This discussion has been closed.
Answers
Are looking for :
mytable = $("#mytable").DataTable();
mytable.ajax.reload();
?
Hi yoannmaingon,
unfortunatly this does not work.
I am not using ajax, but prepopulating the table-data on serverside. So the jquery datatables-skript is working on base on a table rendered within the HTML document (DOM).
In order to enhance ordering I am using the <td data-order="customvalue"> value.
The "customvalue" value is changed via ajax and after the ajax data-change the table's order function does not work correctly: it does not know the new data. So I need to find a way to reload the table's data without having to reload the page.
Any ideas?
Kind regards
Steven