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
949
949
}
950
950
951
951
protected resolveToggle ( groupColumn : IgxColumnComponent , state : boolean ) {
952
- const hasChildGroup = groupColumn . children . filter ( x => x . columnGroup ) . length > 0 ;
953
952
groupColumn . hidden = state ;
954
953
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 => {
958
969
this . resolveToggle ( group , state ) ;
959
970
} ) ;
960
971
}
You can’t perform that action at this time.
0 commit comments