how to force update of datatables
how to force update of datatables
yshtil
Posts: 17Questions: 6Answers: 0
I have three tables that are fed from a server via ajax. The server gets the data from a database that is updated periodically.
How can the server force refresh the tables if a change in the database is detected?
Answers
If you are using the
ajax
option then useajax.reload()
to refresh the Datatables data.Kevin
But how I notify the client that the database changed? I don't want to use setInterval API to bombard the server unnecessarily.
There is nothing built into Datatables for this. There are environments, like node.js, that allow for pushing data from the server to the client to invoke event handlers. You will need to look at documentation or use forums like Stack Overflow to research how to do this for your environment.
Kevin