Scroller + Server Side processing

Scroller + Server Side processing

lexalexa Posts: 3Questions: 0Answers: 0
edited October 2012 in Plug-ins
Hello,

I have a problem setting up infinite scrolling in datatables, so I've created a demo app to demo app to show the issue:

http://dt-scrollinfinite-serverside.herokuapp.com/

Source code: https://github.com/l3x4/datatables-scrollinfinite-serverside-demo

There are 1000 records in the database table and I'd like to show them in the table with the scroller.
The records are delivered by the server in portions of 100 items at a time.
The problem is when the polling happens the records counter is getting incremented twice: it gets +200 every time another 100 records arrive.
So it only scrolls up to record 600, assuming it's 1100 records out of 1000 already shown, so no need to scroll further.

You can inspect the requests and responses from the server on the demo app.
Initialization can also be inspected on the app or in the source code:
https://github.com/l3x4/datatables-scrollinfinite-serverside-demo/blob/master/app/assets/javascripts/buildings.js.coffee

Looks like I either missuse some parameters or missing some parameter...
Does anyone have an idea what's wrong here?

Than you.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Scroller and Infinite scrolling are incompatible (I guess I should put a catch in the Scroller code for that). Scroller is basically the replacement for infinite scrolling, so I'd suggest you just disable infinite scrolling.

    This is what Scroller with server-side processing should work like:
    http://datatables.net/release-datatables/extras/Scroller/server-side_processing.html

    Allan
  • lexalexa Posts: 3Questions: 0Answers: 0
    edited October 2012
    Thank you for your help! Got it working now.

    https://github.com/l3x4/datatables-scrollinfinite-serverside-demo/commit/2d9df4401eff6d3596d4184605550a4dbbb801ba
This discussion has been closed.