-
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
Virtual scroll +lazy load table with Route Reuse strategy - reopen with stackblitz #11179
Comments
Any updates on this one? |
I am having the same issue. |
Hi, Fixed for PrimeNG 14. We changed our virtualScroll implementation. We designed a new scroller API instead of Angular cdk and used it in all components. https://www.dropbox.com/s/tmho3ii70viilgg/virtualscroll.mov?dl=0 Best Regards, |
Hi,
I'm using table with virtual scroll and lazy load and having issues when turning on angular route reuse strategy. When the table is not scrolled (first row visible) everything is fine, but when the table is scrolled to some point, coming back to the page results with the table cut to the scroll point - the headers are shown at the scroll point and the previously loaded data is missing. If I scroll a bit at this point, the data and headers are restored always from the top. Is there a fix for this, or even an event or table function that can be called to fix the table when returning to the page? (keeping the data and the scroll state, of course, this is the idea)
Before leaving the route the scrolled table looks like this:
After returning to the route (we use route reuse strategy), instead of the table looking exactly the same at it was left, it looks like this:
See stackblitz with route reuse: go to page B, scroll the table, go to page A, return to page B - table did not keep the state of scroll and data (shown blank). If you do this without scrolling the table, the data is kept upon returning.
Stackblitz:
https://stackblitz.com/edit/primeng-tablevirtualscroll-demo-dxvheu?file=src/app/app.module.ts
<p-table *ngIf="!loading" [value]="displayedUsers" [scrollable]="true" scrollHeight="flex" [virtualScroll]="true" [virtualRowHeight]="40" [lazy]="true" [rows]="50" (onLazyLoad)="lazyLoad($event)" [lazyLoadOnInit]="false" selectionMode="single" dataKey="userId" >
"primeng": "^13.1.0",
"@angular/core": "~13.1.3",
The text was updated successfully, but these errors were encountered: