Scroller incorrect behavior
Scroller incorrect behavior
Werner_Iten
Posts: 3Questions: 1Answers: 0
Hello.
I have decided to use Scroller for table.
Faced with incorrect length value.
Here is an example - https://jsfiddle.net/nickita/2ucxpoem/.
As you can see I set total records to 33 but it loads 54 records from start because of incorrect length value.
My question is: how length is calculated and how to fix the issue?
Thank you.
This discussion has been closed.
Answers
I would suggest that this is wrong:
It should really check to see if that value is greater than the number of records available (33) and if so, just limit the loop to 33.
The
length
parameter is the page size that DataTables is expecting to display, so even in this case, it is correct an expected thatlength
should be submitted as larger than start + number of records on last page.Allan
Length value is equal to 54 from start. That is why there are 54 rows in table. But I am not sure why start length is 54.
I also have issue in my project.
I have 33 rows in database. I have initialized Scroller and length is equal to 9.
When response comes from server it contzins 9 objects and total = 33.
Those 9 rows are disaplayed inside table but when I scroll down no more objects are loaded.
What do you think?
Im not sure what your trying to achieve but you can limit the total like this:
My point is that the server is returning more data than there actually is - hence the error. If there are less rows than
start + len
for request, then only that limited set should be returned. Don't have it return rows that don't exist.Allan