File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
projects/igniteui-angular/src/lib/grids/selection Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments