Skip to content

Commit 08ceadb

Browse files
committed
chore(Column): reset column colections when show column layout #7390
1 parent 2381cf4 commit 08ceadb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ export class IgxColumnLayoutComponent extends IgxColumnGroupComponent implements
9696
* @memberof IgxColumnGroupComponent
9797
*/
9898
set hidden(value: boolean) {
99-
if (this._hidden === value) { return; }
10099
this._hidden = value;
101100
this.children.forEach(child => child.hidden = value);
102101
if (this.grid && this.grid.columns && this.grid.columns.length > 0) {
103102
// reset indexes in case columns are hidden/shown runtime
104-
const columns = this.grid && this.grid.pinnedColumns && this.grid.unpinnedColumns ?
105-
this.grid.pinnedColumns.concat(this.grid.unpinnedColumns) : [];
106-
if (!this.hidden && !columns.find(c => c.field === this.field)) {
107-
this.grid.resetColumnCollections();
108-
}
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+
}
109108
this.grid.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
110109
}
111110
}

0 commit comments

Comments
 (0)