Skip to content

Commit

Permalink
fix(frozen): hiding multiple columns when using pinning gets out of s…
Browse files Browse the repository at this point in the history
…ync (#684)

* fix(frozen): hiding multiple columns when using pinning gets out of sync
  • Loading branch information
ghiscoding committed Jan 26, 2021
1 parent fffa711 commit a453d76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,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.grid.setOptions({ frozenColumn: recalculatedFrozenColumnIndex });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,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 !== undefined ? this.sharedService.gridOptions.frozenColumn : -1;
if (frozenColumnIndex >= 0 && frozenColumnIndex >= columnIndex) {
this.sharedService.grid.setOptions({ frozenColumn: frozenColumnIndex - 1 });
this.sharedService.gridOptions.frozenColumn = frozenColumnIndex - 1;
this.sharedService.grid.setOptions({ frozenColumn: this.sharedService.gridOptions.frozenColumn });
}

// then proceed with hiding the column in SlickGrid & trigger an event when done
Expand Down

0 comments on commit a453d76

Please sign in to comment.