table.data after table.ajax.reload(); shows data from before the reload
table.data after table.ajax.reload(); shows data from before the reload
mrd05d
Posts: 45Questions: 6Answers: 3
I am using DataTables and the TableTools extension. Im using an ajax button to send selected rows to be deleted from the db. On success i am using table.ajax.reload();. Then after I am trying to see if the result set is empty or not if it is i want to reload the page.
I tried to use table.data() but it is seeing what was in the table prior to the reload not after?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
So i decided to attach an xhr event handler instead of waiting for the table to reload in order to then try and evaluate for empty.
This works well:
That is the correct thing to do :-). The other option is to use
initCallback
at initialisation time, or the callback forreload.ajax()
if you are using that method.Allan