dynamic pagination when scrolling

dynamic pagination when scrolling

MarcBorgersMarcBorgers Posts: 6Questions: 0Answers: 0
edited January 2012 in General
Hello,

I am using datatables. I am very satisfied with it. This question I have is something I am already looking for for a long time.

Most of my table have a vertical scroll bar and data are read from the backend (database) in one go...
Of course this is not scalable. In order to keep control, we limit the number of rows read to some amount.
What I want to do is is paginate dynamically: when the user scrolls downwards and reaches the end of the current data, read
the next page of data and add the data to the control...

I have been searching for such funtionality on your side. I could not find it or in the examples I saw, I was not sure it works
the way I intended.

So my question: is the described funtionality available? If so, could you provide me a link to an example and doc how to do it.

Thanks in advance for your time!

Regards,
Marc

Replies

  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    You mean like this: http://datatables.net/extras/scroller/ :-)

    Blog post describing it here: http://datatables.net/blog/Introducing_Scroller_-_Virtual_Scrolling_for_DataTables

    Documentation here: http://datatables.net/docs/Scroller

    Allan
  • MarcBorgersMarcBorgers Posts: 6Questions: 0Answers: 0
    Thanks! Looks as if it is what I am looking for.
    Where can I find documentation on what parameters are sent to the server side (and their meaning) ?

    Marc
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    Under the "server-side processing" part of the "usage" documentation: http://datatables.net/usage/server-side :-)

    Allan
  • MarcBorgersMarcBorgers Posts: 6Questions: 0Answers: 0
    OK thanks!

    If I understand well (by running your examples): each time you reach the bottom of the scroller, the next 'page' is requested and the sEcho will be increased by 1 and idisplaystart will be the first line of the next page? -> which of the 2 should I use
    If this interpretation is wrong, how else can will be communicated with the server which page it wants?

    Regards,
    Marc
  • allanallan Posts: 63,540Questions: 1Answers: 10,476 Site admin
    That's basically correct. Any redraw (filtering, sorting etc) will cause sEcho to increment,and what is passed in must be passed back, as DataTables uses this as an internal counter to make sure the async Ajax requests don't get out of sync.

    Allan
This discussion has been closed.