Skip to content

Commit 8d8ff38

Browse files
committed
fix(pivotGrid): Fix resource change handler triggering before initialization.
1 parent 1722733 commit 8d8ff38

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,10 +1060,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10601060
localeId,
10611061
platform,
10621062
_diTransactions);
1063-
onResourceChangeHandle(this.destroy$, () => {
1064-
// Since the columns are kinda static, due to assigning DisplayName on init, they need to be regenerated.
1065-
this.setupColumns();
1066-
}, this);
10671063
}
10681064

10691065
/**
@@ -1086,6 +1082,11 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10861082
this.generateConfig();
10871083
}
10881084
this.setupColumns();
1085+
// Bind to onResourceChange after the columns have initialized the first time to avoid premature initialization.
1086+
onResourceChangeHandle(this.destroy$, () => {
1087+
// Since the columns are kinda static, due to assigning DisplayName on init, they need to be regenerated.
1088+
this.setupColumns();
1089+
}, this);
10891090
});
10901091
if (this.valueChipTemplateDirective) {
10911092
this.valueChipTemplate = this.valueChipTemplateDirective.template;
@@ -1102,6 +1103,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
11021103
Promise.resolve().then(() => {
11031104
super.ngAfterViewInit();
11041105
});
1106+
11051107
}
11061108

11071109
/**

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ describe('IgxPivotGrid #pivotGrid', () => {
4646
let fixture: ComponentFixture<IgxPivotGridTestBaseComponent>;
4747

4848
beforeEach(waitForAsync(() => {
49-
getI18nManager().toggleEvents(false);
5049
fixture = TestBed.createComponent(IgxPivotGridTestBaseComponent);
5150
fixture.detectChanges();
52-
getI18nManager().toggleEvents(true);
5351
}));
5452

5553
it('should show empty template when there are no dimensions and values', () => {

0 commit comments

Comments
 (0)