Skip to content

Commit

Permalink
fix(plugin): Grid Menu Clear Frozen Cols shouldn't change cols positi…
Browse files Browse the repository at this point in the history
…ons (#721)
  • Loading branch information
ghiscoding committed Mar 18, 2021
1 parent b4deea9 commit ee07d79
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,10 @@ export class GridMenuExtension implements Extension {
case 'clear-frozen-columns':
const visibleColumns = [...this.sharedService.visibleColumns];
this.sharedService.grid.setOptions({ frozenColumn: -1, enableMouseWheelScrollHandler: false });
if (Array.isArray(visibleColumns) && Array.isArray(this.sharedService.allColumns) && visibleColumns.length !== this.sharedService.allColumns.length) {

// SlickGrid seems to be somehow resetting the columns to their original positions,
// so let's re-fix them to the position we kept as reference
if (Array.isArray(visibleColumns)) {
this.sharedService.grid.setColumns(visibleColumns);
}
break;
Expand Down

0 comments on commit ee07d79

Please sign in to comment.