Infinite Scroll in 1.10
Infinite Scroll in 1.10
We had infinite scroll working on v1.9.?? of datatables. We managed the scroll (vs a datatable plugin) so that when the WINDOW scrollbar hit the bottom of the page, we would pull in the next batch of items from a REST call simply by calling fnPageChange('next'), (see examples in forums). I've been attempting to upgrade to 1.10 and I can't get this to work. In my table config, instead of using fnServerData, I'm using ajax with a function. When my scroll handler calls datatable.page('next').draw(false), the parameters sent to the ajax function are correct (start and length), BUT the table rows are now REPLACED instead of appended to like in the older version. I can kind of hack around this by setting datatable.page.len(BIGGER_PAGE_VALUE).draw(false), but this just changes the length parameter to the ajax call, so first time I get rows 0 - length, then 0 - 2length, then 0 - 3length... not the most efficient way to do things. Is there any way to make this work in 1.10? Thanks!
--m
Answers
The upgrade doc has a note on the removal of infinite scrolling: http://datatables.net/upgrade/1.10#bScrollInfinite . Depending on your actual implementation and what you want, Scroller might work for you, or simply adding more rows to the table using the API. Unfortunately the old infinite scroll just had too many quirks.
Allan