Skip to content

Commit 5c657cb

Browse files
committed
Merge remote-tracking branch 'origin/12.1.x' into sstoychev/add-row-api-12.1
2 parents 555d2a7 + e525ccc commit 5c657cb

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class IgxGridFilteringRowComponent implements AfterViewInit, OnDestroy {
209209
this.cdr.markForCheck();
210210
});
211211

212-
this.focusEditElement();
212+
requestAnimationFrame(() => this.focusEditElement());
213213
}
214214

215215
public get disabled(): boolean {

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
/**

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ export class IgxGridGroupByRowComponent implements OnDestroy {
282282
* @hidden @internal
283283
*/
284284
public get selectedRowsInTheGroup(): any[] {
285-
return this.groupRow.records.filter(rowID => this.gridSelection.filteredSelectedRowIds.indexOf(this.getRowID(rowID)) > -1);
285+
const selectedIds = this.gridSelection.filteredSelectedRowIds;
286+
return this.groupRow.records.filter(rowID => selectedIds.indexOf(this.getRowID(rowID)) > -1);
286287
}
287288

288289
/**

src/app/grid-groupby/grid-groupby.sample.html

+11
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,14 @@
6565

6666
<button igxButton="raised" (click)="hideGroupableRow()">Show/Hide groupable row</button>
6767
</div>
68+
69+
<div class="wrapper">
70+
<h3>Selection Performance</h3>
71+
<igx-grid [data]="data2" [allowFiltering]="true" cellSelection="none" width="1200px"
72+
height="500px" rowSelection="multiple" [groupingExpressions]="perfGrpExpr">
73+
<igx-column field="STATUS" header="Status" width="200px" [groupable]="true" [sortable]="true">
74+
</igx-column>
75+
<igx-column field="FIELD" header="Field" width="200px" [groupable]="true" [sortable]="true">
76+
</igx-column>
77+
</igx-grid>
78+
</div>

src/app/grid-groupby/grid-groupby.sample.ts

+9
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ export class GridGroupBySampleComponent implements OnInit {
1717
private grid1: IgxGridComponent;
1818

1919
public data: Array<any>;
20+
public data2: any[] = [];
2021
public hideGroupedColumns = false;
2122
public expState = [];
2223
public columns: Array<any>;
2324
public groupingExpressions: Array<ISortingExpression>;
25+
public perfGrpExpr = [ { fieldName: 'FIELD', dir: SortingDirection.Asc } ];
2426
public summaryMode: GridSummaryCalculationMode = GridSummaryCalculationMode.rootLevelOnly;
2527
public summaryModes = [];
2628
public selectionModes: any[];
@@ -31,6 +33,13 @@ export class GridGroupBySampleComponent implements OnInit {
3133
constructor(@Inject(DisplayDensityToken) public displayDensityOptions: IDisplayDensityOptions) { }
3234

3335
public ngOnInit(): void {
36+
for (let i = 0; i < 60; i++) {
37+
this.data2.push(...Array(10).fill({ STATUS: 'A', FIELD: 'some text' }));
38+
this.data2.push(...Array(10).fill({ STATUS: 'B', FIELD: 'some text' }));
39+
this.data2.push(...Array(10).fill({ STATUS: 'C', FIELD: 'some text' }));
40+
this.data2.push(...Array(10).fill({ STATUS: 'D', FIELD: 'some text' }));
41+
}
42+
this.data2 = this.data2.map((rec, index) => ({...rec, ID: index}));
3443
this.columns = [
3544
{ dataType: 'string', field: 'ID', width: 100, hidden: true },
3645
{ dataType: 'string', field: 'CompanyName', width: 300, groupable: true },

0 commit comments

Comments
 (0)