Skip to content

Commit fef1577

Browse files
authored
Merge pull request #6629 from IgniteUI/vmihalkov/fix-6593
Only try to hide columns if collumnList contains any columns #6593
2 parents 7a4abb9 + 25186e7 commit fef1577

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/igniteui-angular/src/lib/grids/grid/grid.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
798798
}
799799

800800
private _setGroupColsVisibility(value) {
801-
if (this.columnList && !this.hasColumnLayouts) {
801+
if (this.columnList.length > 0 && !this.hasColumnLayouts) {
802802
this.groupingExpressions.forEach((expr) => {
803803
const col = this.getColumnByName(expr.fieldName);
804804
col.hidden = value;
@@ -1102,7 +1102,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
11021102
public ngDoCheck(): void {
11031103
if (this.groupingDiffer && this.columnList && !this.hasColumnLayouts) {
11041104
const changes = this.groupingDiffer.diff(this.groupingExpressions);
1105-
if (changes && this.columnList) {
1105+
if (changes && this.columnList.length > 0) {
11061106
changes.forEachAddedItem((rec) => {
11071107
const col = this.getColumnByName(rec.item.fieldName);
11081108
col.hidden = true;

0 commit comments

Comments
 (0)