File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
projects/igniteui-angular/src/lib/grids Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -7235,35 +7235,32 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
7235
7235
const expansionRowIndexes = [ ] ;
7236
7236
for ( const [ key , value ] of this . expansionStates . entries ( ) ) {
7237
7237
if ( value ) {
7238
- expansionRowIndexes . push ( key ) ;
7238
+ const rowIndex = this . gridAPI . get_rec_index_by_id ( key , this . dataView ) ;
7239
+ expansionRowIndexes . push ( rowIndex ) ;
7239
7240
}
7240
7241
}
7241
7242
if ( this . selectionService . selection . size > 0 ) {
7242
7243
if ( expansionRowIndexes . length > 0 ) {
7243
7244
for ( const [ key , value ] of this . selectionService . selection . entries ( ) ) {
7244
7245
let updatedKey = key ;
7245
- expansionRowIndexes . forEach ( row => {
7246
- let rowIndex ;
7247
- if ( ! isNaN ( row . ID ) ) {
7248
- rowIndex = Number ( row . ID ) ;
7249
- } else {
7250
- rowIndex = Number ( row ) ;
7251
- }
7252
-
7253
- if ( updatedKey > Number ( rowIndex ) ) {
7254
- updatedKey -- ;
7246
+ let subtract = 0 ;
7247
+ expansionRowIndexes . forEach ( ( row ) => {
7248
+ if ( updatedKey > Number ( row ) ) {
7249
+ subtract ++ ;
7255
7250
}
7256
7251
} ) ;
7257
- selectionCollection . set ( updatedKey , value ) ;
7252
+ selectionCollection . set ( updatedKey - subtract , value ) ;
7258
7253
}
7259
7254
}
7260
7255
} else if ( activeEl ) {
7256
+ let subtract = 0 ;
7261
7257
if ( expansionRowIndexes . length > 0 ) {
7262
7258
expansionRowIndexes . forEach ( row => {
7263
7259
if ( activeEl . row > Number ( row ) ) {
7264
- activeEl . row -- ;
7260
+ subtract ++ ;
7265
7261
}
7266
7262
} ) ;
7263
+ activeEl . row -= subtract ;
7267
7264
}
7268
7265
}
7269
7266
}
You can’t perform that action at this time.
0 commit comments