Skip to content

Commit cf80b1e

Browse files
committed
fix(IgxColumn): populate the visibleIndex correctly on show/hide mrl block #7390
1 parent e2568d4 commit cf80b1e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

projects/igniteui-angular/src/lib/grids/columns/column-layout.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ export class IgxColumnLayoutComponent extends IgxColumnGroupComponent implements
100100
this.children.forEach(child => child.hidden = value);
101101
if (this.grid && this.grid.columns && this.grid.columns.length > 0) {
102102
// reset indexes in case columns are hidden/shown runtime
103-
this.grid.columns.filter(x => x.columnGroup).forEach(x => x.populateVisibleIndexes());
103+
const columns = this.grid && this.grid.pinnedColumns && this.grid.unpinnedColumns ?
104+
this.grid.pinnedColumns.concat(this.grid.unpinnedColumns) : [];
105+
if (!this._hidden && !columns.find(c => c.field === this.field)) {
106+
this.grid.resetColumnCollections();
107+
}
108+
this.grid.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
104109
}
105110
}
106111

0 commit comments

Comments
 (0)