Skip to content

Commit

Permalink
fix(frozen): hiding multiple columns when using pinning gets out of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jan 26, 2021
1 parent 5d4dcdc commit 5cf4bee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/common/src/extensions/extensionUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class ExtensionUtility {
if (frozenColumnIndex >= 0) {
const recalculatedFrozenColumnIndex = visibleColumns.findIndex(col => col.id === this.sharedService.frozenVisibleColumnId);
if (recalculatedFrozenColumnIndex >= 0 && recalculatedFrozenColumnIndex !== frozenColumnIndex) {
this.sharedService.gridOptions.frozenColumn = recalculatedFrozenColumnIndex;
this.sharedService.slickGrid.setOptions({ frozenColumn: recalculatedFrozenColumnIndex });
}

Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/extensions/headerMenuExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ export class HeaderMenuExtension implements Extension {
// we need to do this because SlickGrid freezes by index and has no knowledge of the columns themselves
const frozenColumnIndex = this.sharedService.gridOptions.frozenColumn ?? -1;
if (frozenColumnIndex >= 0 && frozenColumnIndex >= columnIndex) {
this.sharedService.slickGrid.setOptions({ frozenColumn: frozenColumnIndex - 1 });
this.sharedService.gridOptions.frozenColumn = frozenColumnIndex - 1;
this.sharedService.slickGrid.setOptions({ frozenColumn: this.sharedService.gridOptions.frozenColumn });
}

// then proceed with hiding the column in SlickGrid & trigger an event when done
Expand Down
Binary file not shown.

0 comments on commit 5cf4bee

Please sign in to comment.