Server-side processing (5,000,000 rows) example not working as expected - rows jumps on reload
Server-side processing (5,000,000 rows) example not working as expected - rows jumps on reload
I've upgraded to the latest version of DataTables and I'm having problems with tables that make use of server side processing.
One of the problems that I'm seeing can be demonstrated with the example provided by DataTables - https://datatables.net/extensions/scroller/examples/initialisation/server-side_processing.html - 1.10.19 at the time of writing.
Start with refreshed page and you will get an Id of 0-1. On my screen I see about 6 lines of the table
Scroll down row by row. When the top row Id gets to 44-1 the screen will jump and show 27-1. I suspect a 'reload occurred'
Scroll down some more. When I get to 39-1 the screen will jump to 27-1.
Reduce recordsTotal to < 66666 and see what happens.
The problem that I'm seeing in my own code is that the first 150 entries are loaded, but no more are loaded until I scroll down several screens - way past the 150th record. Looking at the ajax request/response Datatables then asks for the wrong data - start is '2'. In my code its only a problem if recordsTotal > 66666 ( a very strange number - test code left in place ? ).
There is something wonky in the maths involved in determining the server-side data to be requested. I hope that fixing the 'example' will also fix my code.
Replies
Hi @David Purdie ,
An issue was raised last week with Scroller (here) and I suspect this is another example. Thanks for making us aware, I'll raise the issue and get it looked into,
Cheers,
Colin
Hi Colin,
Thanks for a prompt reply.
I tried the very latest version of Scroller directly from the master branch.
This does not solve the problem. A little bit digging and I believe the issue is associated with the 'non-linear scrollbar'. Things go bad at the point that the scrollbar goes from linear to non-linear.
I'm seeing two, hopefully related, issues.
1. Miscalculation of the top row. ie: scrolldown and the top row can go backwards.
2. No data being loaded. The decision to load more data is not being taken and the display routines have nothing to display.
Forcing a linear scroll-bar under all conditions solves the two problems, but then the scrollbar cannot be used to reach the end of the table and does not represent the position within the table.
Hi David,
I committed a few changes to Scroller over the weekend. Could you possibly try it again now?
Thanks,
Allan