Skip to content

Commit ceaa304

Browse files
MKirovaMKirova
authored andcommitted
Add check in case there's no dimension is associated with the field map.
1 parent bbc4505 commit ceaa304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
844844
const first = fields.keys().next().value;
845845
const dim: IPivotDimension = fields.get(first).dimension;
846846
let currentFields = fields;
847-
if (dim.sortDirection) {
847+
if (dim && dim.sortDirection) {
848848
const reverse = (dim.sortDirection === SortingDirection.Desc ? -1 : 1);
849849
currentFields = new Map([...fields.entries()].sort((a, b) => reverse * (a > b ? 1 : a < b ? -1 : 0)));
850850
}

0 commit comments

Comments
 (0)