File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
projects/igniteui-angular/src/lib/grids/pivot-grid Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -949,12 +949,23 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
949949 }
950950
951951 protected resolveToggle ( groupColumn : IgxColumnComponent , state : boolean ) {
952- const hasChildGroup = groupColumn . children . filter ( x => x . columnGroup ) . length > 0 ;
953952 groupColumn . hidden = state ;
954953 this . columnGroupStates . set ( groupColumn . field , state ) ;
955- if ( ! groupColumn . hidden && hasChildGroup ) {
956- const groupChildren = groupColumn . children . filter ( x => x . columnGroup ) ;
957- groupChildren . forEach ( group => {
954+ const childrenTotal = this . hasMultipleValues ?
955+ groupColumn . children . filter ( x => x . columnGroup && x . children . filter ( y => ! y . columnGroup ) . length === this . values . length ) :
956+ groupColumn . children . filter ( x => ! x . columnGroup ) ;
957+ const childrenSubgroups = this . hasMultipleValues ?
958+ groupColumn . children . filter ( x => x . columnGroup && x . children . filter ( y => ! y . columnGroup ) . length === 0 ) :
959+ groupColumn . children . filter ( x => x . columnGroup ) ;
960+ childrenTotal . forEach ( group => {
961+ if ( state ) {
962+ group . headerTemplate = this . headerTemplate ;
963+ } else {
964+ group . headerTemplate = undefined ;
965+ }
966+ } ) ;
967+ if ( ! groupColumn . hidden && childrenSubgroups . length > 0 ) {
968+ childrenSubgroups . forEach ( group => {
958969 this . resolveToggle ( group , state ) ;
959970 } ) ;
960971 }
You can’t perform that action at this time.
0 commit comments