How to display x no.of recs and load y no.of more recs when scrolled(using bScrollInfinite,etc) ?

How to display x no.of recs and load y no.of more recs when scrolled(using bScrollInfinite,etc) ?

RojerRojer Posts: 3Questions: 0Answers: 0
edited July 2012 in General
Hi all Datatables.net is awesome.. keep upi the good work..

I am aware of the infinite scroll facilities of datatable.. the options like iDisplayLength, bScrollInfinite, bDeferRender, bPaginate, etc

I know that iDisplayLength's count is used to display more rows in infinite scrolling.

My doubt is how to show 50 records first and then show 5 more records every time user scrolls

Thanks

Replies

  • RojerRojer Posts: 3Questions: 0Answers: 0
    Any ideas ?
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    edited July 2012
    Why do you want to show 50 records first and then show 5 more records every time the user scrolls?

    I am afraid that the 'distance' scrolled is hard-wired in the code.
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    Set iDisplayLength to 50 in the initialisation and then use the fnLengthChange change plug-in ( http://datatables.net/plug-ins/api#fnLengthChange ) to set the paging length to 5 after initialisation. DataTables will load the next records as a 'page'.

    5 isn't many records to add at a time though!

    Also have you considered using Scroller? It is effectively the replacement for infinite scrolling, which is verging on being deprecated these days...

    Allan
  • RojerRojer Posts: 3Questions: 0Answers: 0
    Thanks for the replies.. and it's not 5 rows exactly 15-20..

    Yeah will give a try on scroller too..

    Let me check and get back if any issues.. thanks a lot for the solution allan..
This discussion has been closed.