Server side data, with periodic updating
Server side data, with periodic updating
Hi all,
I'm using DataTables v1.9.0 (thanks for the update!) and I want to update my table with Ajax using the built in methods to get data from the server. I'd also like to update my table periodically using a setTimeout() method that calls DataTables so all of the pagination, sorting, etc. keep working. Is there a way to tie a periodic timer to DataTables?
Thanks,
Doug
I'm using DataTables v1.9.0 (thanks for the update!) and I want to update my table with Ajax using the built in methods to get data from the server. I'd also like to update my table periodically using a setTimeout() method that calls DataTables so all of the pagination, sorting, etc. keep working. Is there a way to tie a periodic timer to DataTables?
Thanks,
Doug
This discussion has been closed.
Replies
1) add to your table in order to remember the state (it creates cookie) [code] "bStateSave": true [/code]
2) and then set autorefresh (in example I have periodic refresh each 30s)
[code]
setInterval(function() {
oTable.fnDraw(false);
},30000);
[/code]
the way i did it was with the normal table call and then right after doing:
[code]
setInterval(function() {otable.fnReloadAjax(null)}, 5000);
[/code]
make sure you change 5000 to what ever time in seconds that you want it to refresh x 1000