-
Notifications
You must be signed in to change notification settings - Fork 126
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
fix(platform): fdp-table sorting visible columns state get lost #12429
base: main
Are you sure you want to change the base?
fix(platform): fdp-table sorting visible columns state get lost #12429
Conversation
Visit the preview URL for this PR (updated for commit 56570af): https://fundamental-ngx-gh--pr12429-fix-fdp-table-fdp-t-t924fonh.web.app (expires Sat, 21 Sep 2024 09:35:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 41b993ee8e451bd7c6770b342ce142dc886eacff |
✅ Deploy Preview for fundamental-ngx ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
libs/platform/table/components/table-p13-dialog/columns/columns.component.ts
Outdated
Show resolved
Hide resolved
@@ -329,11 +320,11 @@ export class P13ColumnsDialogComponent implements Resettable, OnInit, OnDestroy | |||
.pipe(debounceTime(20)) | |||
.subscribe(([showAll, searchQuery]) => { | |||
this._filteredColumns = this._selectableColumns | |||
.sort((a, b) => a.order - b.order) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think instead of sort it here you can sort it inside _initiateColumns method, with that way you can reduce manipulation on array.
…umns-state-get-lost
…-visible-columns-state-get-lost' into fix(fdp-table)-fdp-table-sorting-visible-columns-state-get-lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to remove a console.log but looks good
@@ -292,25 +294,18 @@ export class P13ColumnsDialogComponent implements Resettable, OnInit, OnDestroy | |||
*/ | |||
private _initiateColumns(visibleColumnKeys: string[]): void { | |||
const visibleColumnIndexMap = new Map(visibleColumnKeys.map((key, index) => [key, index])); | |||
console.log(this.availableColumns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, just pull this console log out before merging
closes (#12397)[https://github.com//issues/12397]
Description
Ensures the sort order of visible columns is maintained within the customization visible columns dialog of the fdp-table component. This fix prevents the columns from reverting to their original order when the dialog is reopened.