Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit a6737a0

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
fix(header): hidding column from header menu after reordering fixes #62
- we should always use the SlickGrid getColumns when doing any search of column index. This is especially true after changing the order, get the getColumns() should always be the reference
1 parent f2b3bab commit a6737a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/modules/angular-slickgrid/services/controlAndPlugin.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ export class ControlAndPluginService {
420420

421421
/** Hide a column from the grid */
422422
hideColumn(column: Column) {
423-
if (this._grid && this.visibleColumns) {
423+
if (this._grid && this._grid.getColumns && this._grid.setColumns) {
424424
const columnIndex = this._grid.getColumnIndex(column.id);
425-
this.visibleColumns = this.removeColumnByIndex(this.visibleColumns, columnIndex);
425+
this.visibleColumns = this.removeColumnByIndex(this._grid.getColumns(), columnIndex);
426426
this._grid.setColumns(this.visibleColumns);
427427
}
428428
}

0 commit comments

Comments
 (0)