Skip to content

Commit e525ccc

Browse files
authored
Merge pull request #10086 from IgniteUI/ddincheva/columnsGetterFixs-12.1.x
Expose columnsCollection property --12.1.x
2 parents 230e853 + 451db15 commit e525ccc

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
29872987
};
29882988

29892989
private transactionChange$ = new Subject<void>();
2990-
2990+
private _rendered = false;
29912991
private readonly DRAG_SCROLL_DELTA = 10;
29922992

29932993
/**
@@ -3672,6 +3672,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
36723672
this.paginator.totalRecords = this.totalRecords;
36733673
this.paginator.overlaySettings = { outlet: this.outlet };
36743674
}
3675+
this._rendered = true;
36753676
});
36763677
Promise.resolve().then(() => this.rendered.next(true));
36773678
}
@@ -4026,16 +4027,24 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
40264027
return this.featureColumnsWidth();
40274028
}
40284029

4030+
/**
4031+
* @hidden
4032+
* @internal
4033+
*/
4034+
public get columns(): IgxColumnComponent[] {
4035+
return this._columns;
4036+
}
4037+
40294038
/**
40304039
* Gets an array of `IgxColumnComponent`s.
40314040
*
40324041
* @example
40334042
* ```typescript
4034-
* const colums = this.grid.columns.
4043+
* const colums = this.grid.columnsCollection.
40354044
* ```
40364045
*/
4037-
public get columns(): IgxColumnComponent[] {
4038-
return this._columns;
4046+
public get columnsCollection(): IgxColumnComponent[] {
4047+
return this._rendered ? this._columns : [];
40394048
}
40404049

40414050
/**

0 commit comments

Comments
 (0)