Skip to content

Commit 7aadde3

Browse files
Vasil MihalkovVasil Mihalkov
authored andcommitted
fix(grid): Only hide col if collist.length>0 #6593
1 parent c82a959 commit 7aadde3

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
@@ -655,7 +655,7 @@ export class IgxGridComponent extends IgxGridBaseComponent implements IGridDataB
655655
}
656656

657657
private _setGroupColsVisibility(value) {
658-
if (this.columnList && !this.hasColumnLayouts) {
658+
if (this.columnList.length > 0 && !this.hasColumnLayouts) {
659659
this.groupingExpressions.forEach((expr) => {
660660
const col = this.getColumnByName(expr.fieldName);
661661
col.hidden = value;
@@ -916,7 +916,7 @@ export class IgxGridComponent extends IgxGridBaseComponent implements IGridDataB
916916
public ngDoCheck(): void {
917917
if (this.groupingDiffer && this.columnList && !this.hasColumnLayouts) {
918918
const changes = this.groupingDiffer.diff(this.groupingExpressions);
919-
if (changes && this.columnList) {
919+
if (changes && this.columnList.length > 0) {
920920
changes.forEachAddedItem((rec) => {
921921
const col = this.getColumnByName(rec.item.fieldName);
922922
col.hidden = true;

0 commit comments

Comments
 (0)