File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
projects/igniteui-angular/src/lib/grids/pivot-grid Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
203203 const fieldColumn = parentCols . filter ( x => x . header === col . header && ! x . columnGroup ) [ 0 ] ;
204204 const groupColumn = parentCols . filter ( x => x . header === col . header && x . columnGroup ) [ 0 ] ;
205205 groupColumn . hidden = newState ;
206- if ( ! groupColumn . hidden && groupColumn . children . length > 1 ) {
206+ const hasChildGroup = groupColumn . children . filter ( x => x . columnGroup ) . length > 0 ;
207+ if ( ! groupColumn . hidden && hasChildGroup ) {
207208 // column group when shown displays all children, we want to show only groups
208209 const fieldChildren = groupColumn . children . filter ( x => ! x . columnGroup ) ;
209210 fieldChildren . forEach ( fieldChild => {
@@ -263,7 +264,9 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
263264 ref . instance . header = key ;
264265 ref . instance . parent = parent ;
265266 ref . instance . header = parent != null ? key . split ( parent . header + '-' ) [ 1 ] : key ;
266- ref . instance . headerTemplate = this . headerTemplate ;
267+ if ( value . expandable ) {
268+ ref . instance . headerTemplate = this . headerTemplate ;
269+ }
267270 const children = this . generateColumnHierarchy ( value . children , data , ref . instance ) ;
268271
269272 const refSibling = factoryColumn . create ( this . viewRef . injector ) ;
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export class PivotUtil {
3636 if ( col . childLevels != null && col . childLevels . length > 0 ) {
3737 const childValues = this . extractValuesFromDimension ( col . childLevels , recData ) ;
3838 vals [ lvl ] . children = childValues ;
39+ vals [ lvl ] . expandable = true ;
3940 }
4041 lvl ++ ;
4142 if ( ! lvlCollection [ 0 ] . children ) {
You can’t perform that action at this time.
0 commit comments