Skip to content

Commit 3ed02e1

Browse files
committed
feat(IgxColumn): update colapsible state when visibleOnCollapse is changed #3343
1 parent fcf1ae3 commit 3ed02e1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
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
@@ -39,7 +39,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
3939
public set collapsible(value: boolean) {
4040
this._collapsible = value;
4141
this.collapsibleChange.emit(this._collapsible);
42-
if (this.children) {
42+
if (this.children && !this.hidden) {
4343
if (value) {
4444
this.setExpandCollapseState();
4545
} else {

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,18 @@ export class IgxColumnComponent implements AfterContentInit {
10211021
@Input()
10221022
set visibleOnCollapse(value: boolean) {
10231023
this._visibleOnCollapse = value;
1024+
if (this.parent) {
1025+
const cols = this.parent.children.map(child => child.visibleOnCollapse);
1026+
if (!(cols.some(c => c === true) && cols.some(c => c === false))) {
1027+
this.parent.collapsible = false;
1028+
} else {
1029+
this.parent.collapsible = true;
1030+
}
1031+
}
10241032
}
10251033

10261034
get visibleOnCollapse(): boolean {
1027-
if (!this.parent) { return false; }
1035+
if (!this.parent) { return; }
10281036
return this._visibleOnCollapse;
10291037
}
10301038

0 commit comments

Comments
 (0)