File tree Expand file tree Collapse file tree 2 files changed +38
-29
lines changed
projects/igniteui-angular/src/lib/grids Expand file tree Collapse file tree 2 files changed +38
-29
lines changed Original file line number Diff line number Diff line change @@ -411,11 +411,19 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
411411 this . dataView . forEach ( record => {
412412 const prev = [ ] ;
413413 for ( const dim of this . rowDimensions ) {
414- const currDim = record [ dim . memberName ] ? dim : record [ dim . childLevel . memberName ] ? dim . childLevel : dim ;
415- const key = PivotUtil . getRecordKey ( record , currDim , prev ) ;
416- prev . push ( currDim ) ;
417- if ( this . selectionService . isPivotRowSelected ( key ) && ! selectedRowIds . find ( x => x === record ) ) {
418- selectedRowIds . push ( record ) ;
414+ let currDim = dim ;
415+ let shouldBreak = false ;
416+ do {
417+ const key = PivotUtil . getRecordKey ( record , currDim , prev ) ;
418+ if ( this . selectionService . isPivotRowSelected ( key ) && ! selectedRowIds . find ( x => x === record ) ) {
419+ selectedRowIds . push ( record ) ;
420+ shouldBreak = true ;
421+ break ;
422+ }
423+ currDim = currDim . childLevel ;
424+ } while ( currDim ) ;
425+ prev . push ( dim ) ;
426+ if ( shouldBreak ) {
419427 break ;
420428 }
421429 }
@@ -449,29 +457,29 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
449457 @Inject ( LOCALE_ID ) localeId : string ,
450458 protected platform : PlatformUtil ,
451459 @Optional ( ) @Inject ( IgxGridTransaction ) protected _diTransactions ?: TransactionService < Transaction , State > ) {
452- super (
453- selectionService ,
454- colResizingService ,
455- gridAPI ,
456- transactionFactory ,
457- elementRef ,
458- zone ,
459- document ,
460- cdr ,
461- resolver ,
462- differs ,
463- viewRef ,
464- appRef ,
465- moduleRef ,
466- factoryResolver ,
467- injector ,
468- navigation ,
469- filteringService ,
470- overlayService ,
471- summaryService ,
472- _displayDensityOptions ,
473- localeId ,
474- platform ) ;
460+ super (
461+ selectionService ,
462+ colResizingService ,
463+ gridAPI ,
464+ transactionFactory ,
465+ elementRef ,
466+ zone ,
467+ document ,
468+ cdr ,
469+ resolver ,
470+ differs ,
471+ viewRef ,
472+ appRef ,
473+ moduleRef ,
474+ factoryResolver ,
475+ injector ,
476+ navigation ,
477+ filteringService ,
478+ overlayService ,
479+ summaryService ,
480+ _displayDensityOptions ,
481+ localeId ,
482+ platform ) ;
475483 }
476484
477485 /**
Original file line number Diff line number Diff line change @@ -494,7 +494,8 @@ export class IgxGridSelectionService {
494494 public isPivotRowSelected ( rowID ) : boolean {
495495 let contains = false ;
496496 this . rowSelection . forEach ( x => {
497- if ( rowID . includes ( x ) ) {
497+ const correctRowId = rowID . replace ( x , '' ) ;
498+ if ( rowID . includes ( x ) && ( correctRowId === '' || correctRowId . startsWith ( '_' ) ) ) {
498499 contains = true ;
499500 return ;
500501 }
You can’t perform that action at this time.
0 commit comments