iDisplayStart vs. fnReloadAjax

iDisplayStart vs. fnReloadAjax

vcba79vcba79 Posts: 3Questions: 0Answers: 0
edited November 2009 in General
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,

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi vcba79,

    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
This discussion has been closed.