Skip to content

Commit c1bb468

Browse files
MKirovaMKirova
authored andcommitted
Ensure only group children are shown on expand.
1 parent 4e1f3ed commit c1bb468

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ 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) {
207+
// column group when shown displays all children, we want to show only groups
208+
const fieldChildren = groupColumn.children.filter(x => !x.columnGroup);
209+
fieldChildren.forEach(fieldChild => {
210+
fieldChild.hidden = true;
211+
});
212+
}
206213
fieldColumn.hidden = !newState;
207214
if (newState) {
208215
fieldColumn.headerTemplate = this.headerTemplate;

0 commit comments

Comments
 (0)