@@ -4,8 +4,10 @@ import {
4
4
Component ,
5
5
ElementRef ,
6
6
Inject ,
7
+ OnChanges ,
7
8
QueryList ,
8
9
Renderer2 ,
10
+ SimpleChanges ,
9
11
ViewChildren
10
12
} from '@angular/core' ;
11
13
import { first } from 'rxjs/operators' ;
@@ -38,7 +40,7 @@ import { PivotUtil } from './pivot-util';
38
40
selector : 'igx-pivot-header-row' ,
39
41
templateUrl : './pivot-header-row.component.html'
40
42
} )
41
- export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
43
+ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent implements OnChanges {
42
44
public aggregateList : IPivotAggregator [ ] = [ ] ;
43
45
44
46
public value : IPivotValue ;
@@ -75,7 +77,9 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
75
77
@ViewChildren ( 'notifyChip' )
76
78
public notificationChips : QueryList < IgxChipComponent > ;
77
79
78
- public get columnDimensionsByLevel ( ) {
80
+ public columnDimensionsByLevel : any [ ] ;
81
+
82
+ public populateColumnDimensionsByLevel ( ) {
79
83
const res = [ ] ;
80
84
const columnDimensions = this . grid . columnDimensions ;
81
85
const cols = this . unpinnedColumnCollection ;
@@ -88,7 +92,13 @@ export class IgxPivotHeaderRowComponent extends IgxGridHeaderRowComponent {
88
92
const colsForLevel = cols . filter ( x => x . level === lvl ) ;
89
93
res [ i ] = colsForLevel ;
90
94
}
91
- return res ;
95
+ this . columnDimensionsByLevel = res ;
96
+ }
97
+
98
+ public ngOnChanges ( changes : SimpleChanges ) {
99
+ if ( changes . unpinnedColumnCollection ) {
100
+ this . populateColumnDimensionsByLevel ( ) ;
101
+ }
92
102
}
93
103
94
104
public onDimDragStart ( event , area ) {
0 commit comments