Skip to content

Commit 93eee71

Browse files
authored
Merge branch '17.2.x' into rivanova/fix-14529-17.2.x
2 parents 6f34ebe + 0fb79cd commit 93eee71

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

projects/igniteui-angular/src/lib/grids/selection/selection.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,10 @@ export class IgxGridSelectionService {
400400
return Array.from(this.rowSelection);
401401
}
402402
const selection = [];
403+
const gridDataMap = {};
404+
this.grid.gridAPI.get_all_data(true).forEach(row => gridDataMap[this.getRecordKey(row)] = row);
403405
this.rowSelection.forEach(rID => {
404-
const rData = this.grid.gridAPI.get_all_data(true).find(row => this.getRecordKey(row) === rID);
406+
const rData = gridDataMap[rID];
405407
const partialRowData = {};
406408
partialRowData[this.grid.primaryKey] = rID;
407409
selection.push(rData ? rData : partialRowData);
@@ -607,9 +609,9 @@ export class IgxGridSelectionService {
607609
if (this.allRowsSelected !== undefined && !newSelection) {
608610
return this.allRowsSelected;
609611
}
610-
const selectedData = newSelection ? newSelection : [...this.rowSelection]
612+
const selectedData = new Set(newSelection ? newSelection : [...this.rowSelection]);
611613
const allData = this.getRowIDs(this.allData);
612-
const unSelectedRows = allData.filter(row => !selectedData.includes(row));
614+
const unSelectedRows = allData.filter(row => !selectedData.has(row));
613615
return this.allRowsSelected = this.allData.length > 0 && unSelectedRows.length === 0;
614616
}
615617

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div style="height: 100vh; width: 100wh">
22
<h4 class="sample-title"> Fixed Size Rows</h4>
3-
<igx-grid #grid1 [rowHeight]="20" displayDensity="compact" [data]="localData" [rowSelection]="selectionMode" [allowFiltering]="true" [filterMode]="'excelStyleFilter'">
3+
<igx-grid #grid1 [rowHeight]="20" primaryKey="ID" displayDensity="compact" [data]="localData" [rowSelection]="selectionMode" [allowFiltering]="true" [filterMode]="'excelStyleFilter'">
44
<igx-grid-toolbar [displayDensity]="grid1.displayDensity">
55
<igx-grid-toolbar-actions>
66
<igx-grid-toolbar-pinning></igx-grid-toolbar-pinning>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class GridPerformanceSampleComponent implements OnInit {
2020
public selectionMode;
2121

2222
public ngOnInit() {
23-
this.selectionMode = GridSelectionMode.none;
23+
this.selectionMode = GridSelectionMode.multiple;
2424
const cols = [];
2525
cols.push({
2626
field: 'ID',

0 commit comments

Comments
 (0)