I'm facing issue while rendering data from server side using Ajax post request
I'm facing issue while rendering data from server side using Ajax post request
Response from the Server is correct, but the totalRecords and the records in the datatable is not matching.
Observed few things:
1. if the length is given as 10 then draw is not working properly
2. if the length is 50 then draw is working but missing few records at the end.
3. if the length is 100 gets full records but sometimes based on the scrollY value misses few records.
getting confused with scrollY height and length ... if i change these values missing few records in the datatable.
Please help me with this.
This question has an accepted answers - jump to answer
Answers
Data should be shown from 991-999 but last draw is making call with below parameters
Length : 30
start:910
Im not able to scroll further as this is end.
Thanks
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi Colin,
I have standalone spring application with built-in tomcat. How do i share that here?
Thanks,
Bindu
If you can share it externally, linking to the page would be easiest. This kind of issue is going to be dependent on your implementation, so we need to see it to progress it.
Colin
Hi Colin,
I have replicated the issue in the below URL, please take a look.
Url : https://jsfiddle.net/8hnrz9Lv/3/
Observations:
Thank you.
Thanks for that test case, that helps understand what's happening.
The problem is that when you use Scroller, there's a number of records that Scroller buffers - see
scroller.displayBuffer
. If you fiddle with the number of records requested, that's going to mess up Scroller in unexpected ways, as you're seeing.If you want to return less data from the server, just adjust
scroller.displayBuffer
,Colin
Worked !!!
Thank you Colin
This will help us to update displayBuffer, but how to reduce number of records fetching from the server?(this is why i was updating data.length:10)
Here by default based on scrollY it fetches 90-100 records from the server, how can i reduce that to 20-30 records?
Thank you.
worked !!!
Please ignore the previous comment.
Thanks for the support.