iDisplayStart vs. fnReloadAjax
iDisplayStart vs. fnReloadAjax
Hi, all
I just understand that set iDisplayStart value while initializing datatable can display page n instead of page 1. But sometime I need to use fnReloadAjax to reload datatable, how can I do the same thing after fnReloadAjax call finished?
Thanks,
I just understand that set iDisplayStart value while initializing datatable can display page n instead of page 1. But sometime I need to use fnReloadAjax to reload datatable, how can I do the same thing after fnReloadAjax call finished?
Thanks,
This discussion has been closed.
Replies
When you call fnReloadAjax, as you are seeing it will reset iDisplayStart during the draw. This is because the filtering and sorting is rebuilt with the new data, and the data positions will likely have changed - so it jumps back to the start. To get around this, what you can do is to read iDisplayStart just before the draw, and then set it back again after the draw in fnReloadAjax, and draw the table yourself (using fnDraw(false); for speed)). Probably a good way to do this is just add this into the plug-in.
Regards,
Allan