Datatable makes multiple calls to lazyload method with different event.first at the same scroll location
I'm submitting a ... (check one with "x")
[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports)
https://plnkr.co/edit/CoSqvdoZkVnA4vDpSMWD?p=preview
Current behavior Multiple calls are made to lazyLoad method with different event.first values at the same scroll location.
Expected behavior Only one call should be made.
Minimal reproduction of the problem with instructions
- In the given plunker, scroll down and stop at record 41/(any record with event.first + event.rows + 1). You will see the datatable flickering with multiple records. If you open the console, you will see multiple calls being made to the lazyLoad method.(I am printing event.first, event.rows values to the console for each call).
What is the motivation / use case for changing the behavior?
Please tell us about your environment: Angular 4.2.6, PrimeNg 4.1.0
-
Angular version: 4.2.6
-
PrimeNG version: 4.1.0
-
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] Chrome definitely.
-
Language: [all | TypeScript X.X | ES6/7 | ES5]
-
Node (for AoT issues):
node --version=
My understanding is that when datatable makes a call to lazyload at a scroll location, it first makes the call for the set of records after that location, then since it is at that point, it again makes that call for the set of records before that.
So, for example, if (event.rows = 10), when the scroll bar reaches the point for record number 11, datatable makes a call for records(11,20). However, at the same point, it makes a call for records (1,10), because the boundary is the same, and this continues in an infinite manner. Is this the right behaviour?
Similarly, when number of rows to be displayed in the table is 20 (event.rows= 40), when the scrollbar reaches location for row 41, calls for records(0,40) and (20,60) get called in an infinite loop until the user moves away from that location. Only the second call(20,60) should be triggered.
This is the same as #3377 . Please close this issue.
Please always test with latest version before creating issues.
I am also facing same issue.. and the lazyload event is calling multiple times...
I am using Primeng 6.1.7.... Even issue still is there.... Can you please take it as high priority....