-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p-table triggers lazy loading event twice #16182
Comments
Are there any news on this ticket? |
Hi, if you are still experiencing the issue with version 17.18.7, could you create a StackBlitz example? |
I have been able to replicate this on PrimeNg 17.18.7. Look at the console log whenever you sort or filter a table column, it logs 2 lazy load events, when it should only log 1 https://stackblitz.com/edit/oetsny-rdsoxe?file=src%2Fapp%2Fdemo%2Ftable-virtual-scroll-lazy-demo.ts |
@SaajRP, In the meantime, I have also created a demo. Here you can see that only one lazy load event is called - in any case, even if filtering and then sorting are performed first. It's very simple, but I cannot see what difference to my (admittedly more complex program with the call to the backend) causes this double lazy loading. I use PrimeNg 18 and Angular 18 and dynamic columns. Could you please check, if my demo is meaningful enough for this test and what the difference is to your program, @mehmetcetin01140, @SaajRP? When you have the same issue it must be a combination of p-table settings that leads to the double lazy loading. In the meantime, I will carry out this comparison with my program and let you know if I have any results. Thank you and kind regards |
On your StackBlitz instance, I set the customSort property to true on p-table (as I assume sorting will be handled by your API instead of the client), now whenever I sort, it logs the lazy load event twice |
I'm experiencing the same issue. Setting Tried with primeng@17.18.8 and the bug is still there Forked StackBlitz: https://stackblitz.com/edit/mkvney-jrqaze?file=src%2Fapp%2Fdemo%2Ftable-multiple-selection-demo.html |
Hi @ahaller-billtrust, |
Fixed #16182 - p-table triggers lazy loading event twice
Tested in my program with PrimeNg 17.18.8 and now it works well. |
@mehmetcetin01140 , I've updated my Stackblitz instance to PrimeNg 17.18.9 (https://stackblitz.com/edit/oetsny-rdsoxe?file=src%2Fapp%2Fdemo%2Ftable-virtual-scroll-lazy-demo.ts,package.json), this is still an issue. In the console, it continues to log 2 events whenever the user has entered a new value into a given filter |
Describe the bug
My table definition looks like this:
We're faced with the issue that the combination of column filter and sorting triggers the lazy loading twice.
Sorting and then column filter works fine, sorting without column filter also.
As soon as there is a column filter in the LazyLoadingEvent, a sorting triggers twice, and therefore we have two backend calls immediately after each other.
I found a similar ticket that contains almost the same issue with PrimeNg version 14 from February 23, still open:
#12595
Environment
Windows 11 Enterprise
Reproducer
No response
Angular version
17.3.12
PrimeNG version
17.18.6
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v20.11.1
Browser(s)
Chrome
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: