-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Component: p-table column order not restored #14888
Comments
Hi, Thanks for reporting the issue, we'll try to address this one in 17.11.0 |
Fixed #14888 - Restore reordered columns
@cetincakiroglu 17.11.0 doesn't fix this issue for me - columns order is still saved to the storage, but doesn't get applied on refresh. @chrissl33 is the issue fixed for you? |
Hi, I´ll take a look at the primeng code again today and let you know if i find something. Best regards, |
Well...i only get it to work, when listening to the (onStateRestore) Output and sort my columns Input myself. So i guess, i can also listen to the (onStateSave) Output...call my sort function and update the columns input myself...but this surely cannot be the solution intended to!? @f2404 Best regards, |
Hi @f2404 Thanks a lot for the feedback I'm re-opening the issue and we'll re-visit this one with v17.12 or the next release. |
Hi, Thanks to your reports, I've found that there is an extra call of restoreColumnOrder in restoreState method. It was also called within ngOnChanges which led to an override of state values. It's fixed now, could you please test it after the release? |
Fixed #14888 - Remove extra conditional
Thank you! |
We'll release it today. |
Sorry, but 17.12.0 makes no difference to me :( |
Describe the bug
Column order is not restored
After the table is saving it´s state the column order is saved under property "columnOrder", but it´s never restored again.
For example, after page refresh or navigation.
I already looked inside the code of the primeNG table and found following method, which takes care of restoring the table state:
As you can see, the column order was not taken into account, therefore is not restored.
Environment
Angular 17
PrimeNG 17.7.0
Reproducer
No response
Angular version
17.0.1
PrimeNG version
17.7.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.11.0
Browser(s)
Chrome (122.0.6261.69)
Steps to reproduce the behavior
Expected behavior
Column order is restored after page refresh or navigation
The text was updated successfully, but these errors were encountered: