From ee07d790fb0ab6141c1f6406b1c3b16f7db0f40f Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Thu, 18 Mar 2021 09:39:53 -0400 Subject: [PATCH] fix(plugin): Grid Menu Clear Frozen Cols shouldn't change cols positions (#721) --- .../angular-slickgrid/extensions/gridMenuExtension.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/modules/angular-slickgrid/extensions/gridMenuExtension.ts b/src/app/modules/angular-slickgrid/extensions/gridMenuExtension.ts index 898ecb616..2dc5e4f2a 100644 --- a/src/app/modules/angular-slickgrid/extensions/gridMenuExtension.ts +++ b/src/app/modules/angular-slickgrid/extensions/gridMenuExtension.ts @@ -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;