Skip to content

Commit 65dfb8f

Browse files
committed
feat(IgxColumnGroup): update collapsible state on visibleCollapse change #3343
1 parent 6b2d313 commit 65dfb8f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
240240
this.children.forEach(child => {
241241
child.parent = this;
242242
});
243-
if (this._collapsible && this.checkCollapsibleState()) {
243+
if (this.collapsible) {
244244
this.setExpandCollapseState();
245245
}
246246
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,10 +1025,7 @@ export class IgxColumnComponent implements AfterContentInit {
10251025
set visibleWhenCollapsed(value: boolean) {
10261026
this._visibleWhenCollapsed = value;
10271027
this.visibleWhenCollapsedChange.emit(this._visibleWhenCollapsed);
1028-
if (this.parent) {
1029-
if (!this.parent.collapsible) { this.hidden = this.parent.hidden; return; }
1030-
this.hidden = this.parent.expanded ? this._visibleWhenCollapsed : !this._visibleWhenCollapsed;
1031-
}
1028+
if (this.parent) { this.parent.setExpandCollapseState(); }
10321029
if (this.grid) {
10331030
this.grid.notifyChanges(true);
10341031
}
@@ -1768,6 +1765,7 @@ export class IgxColumnComponent implements AfterContentInit {
17681765
*/
17691766
protected setExpandCollapseState() {
17701767
this.children.filter(col => (col.visibleWhenCollapsed !== undefined)).forEach(c => {
1768+
if (!this.collapsible) { c.hidden = this.parent.hidden; return; }
17711769
c.hidden = this._expanded ? c.visibleWhenCollapsed : !c.visibleWhenCollapsed;
17721770
});
17731771
}

0 commit comments

Comments
 (0)