Skip to content

Commit d9921e9

Browse files
committed
Merge branch 'dkamburov/pivot-pipes' of https://github.com/IgniteUI/igniteui-angular into dkamburov/pivot-pipes
2 parents 8aeb44e + e87ef89 commit d9921e9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
251251
hierarchy.get(val.value).children.set(child.value, child);
252252
}
253253
} else {
254+
const children = val.children;
254255
hierarchy.set(val.value, val);
255256
hierarchy.get(val.value).children = new Map<string, any>();
256-
for (const child of val.children) {
257+
for (const child of children) {
257258
hierarchy.get(val.value).children.set(child.value, child);
258259
}
259260
}
@@ -267,7 +268,15 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
267268
let i = 0;
268269
for (const col of dims) {
269270
const value = typeof col.member === 'string' ? recData[col.member] : col.member.call(this, recData);
270-
vals.push({ value });
271+
if (vals.length > 0) {
272+
const newChildVal = vals[0].value + '-' + value;
273+
if(!vals[0].children) {
274+
vals[0].children = [];
275+
}
276+
vals[0].children.push({ value });
277+
} else {
278+
vals.push({ value });
279+
}
271280
if (col.childLevels != null && col.childLevels.length > 0) {
272281
const childValues = this.extractValuesFromDimension(col.childLevels, recData);
273282
vals[i].children = childValues;

0 commit comments

Comments
 (0)