Skip to content

Commit 5403c1a

Browse files
authored
Merge branch 'master' into vkombov/feat-10634-master
2 parents 82d911c + dc2b9ff commit 5403c1a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import {
2323
ViewContainerRef,
2424
Injector,
2525
NgModuleRef,
26-
ApplicationRef} from '@angular/core';
26+
ApplicationRef
27+
} from '@angular/core';
2728
import { IgxGridBaseDirective } from '../grid-base.directive';
2829
import { IgxFilteringService } from '../filtering/grid-filtering.service';
2930
import { IgxGridSelectionService } from '../selection/selection.service';
@@ -648,7 +649,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
648649
dropdown.overlayComponentId = id;
649650
return { id, ref: undefined };
650651
}
651-
return {id: dropdown.overlayComponentId, ref: undefined};
652+
return { id: dropdown.overlayComponentId, ref: undefined };
652653
}
653654
}
654655

@@ -1144,11 +1145,12 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
11441145
if (dimType === PivotDimensionType.Column) {
11451146
this.setupColumns();
11461147
}
1147-
if (!dimension.enabled) {
1148+
if (!dimension.enabled && dimension.filter) {
11481149
this.filteringService.clearFilter(dimension.memberName);
11491150
}
11501151
this.pipeTrigger++;
11511152
this.dimensionsChange.emit({ dimensions: collection, dimensionCollectionType: dimType });
1153+
this.cdr.detectChanges();
11521154
}
11531155

11541156
/**
@@ -1264,9 +1266,9 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
12641266
protected rowDimensionContentCollection: QueryList<IgxPivotRowDimensionContentComponent>;
12651267

12661268
protected getDimensionType(dimension: IPivotDimension): PivotDimensionType {
1267-
return PivotUtil.flatten(this.rowDimensions).indexOf(dimension) !== -1 ? PivotDimensionType.Row :
1268-
PivotUtil.flatten(this.columnDimensions).indexOf(dimension) !== -1 ? PivotDimensionType.Column :
1269-
PivotUtil.flatten(this.filterDimensions).indexOf(dimension) !== -1 ? PivotDimensionType.Filter : null;
1269+
return PivotUtil.flatten(this.pivotConfiguration.rows).indexOf(dimension) !== -1 ? PivotDimensionType.Row :
1270+
PivotUtil.flatten(this.pivotConfiguration.columns).indexOf(dimension) !== -1 ? PivotDimensionType.Column :
1271+
PivotUtil.flatten(this.pivotConfiguration.filters).indexOf(dimension) !== -1 ? PivotDimensionType.Filter : null;
12701272
}
12711273

12721274
protected getLargesContentWidth(contents: ElementRef[]): string {
@@ -1509,8 +1511,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
15091511
const factoryColumnGroup = this.resolver.resolveComponentFactory(IgxColumnGroupComponent);
15101512
const key = value.value;
15111513
const ref = isGroup ?
1512-
factoryColumnGroup.create(this.viewRef.injector) :
1513-
factoryColumn.create(this.viewRef.injector);
1514+
factoryColumnGroup.create(this.viewRef.injector) :
1515+
factoryColumn.create(this.viewRef.injector);
15141516
ref.instance.header = parent != null ? key.split(parent.header + this.pivotKeys.columnDimensionSeparator)[1] : key;
15151517
ref.instance.field = key;
15161518
ref.instance.parent = parent;

src/app/pivot-grid/pivot-grid.sample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export class PivotGridSampleComponent {
246246
}
247247

248248
public toggle(){
249-
this.grid1.toggleDimension({memberName: 'test', enabled: true});
249+
this.grid1.toggleDimension(this.dimensions[2]);
250250
}
251251

252252
public move(){

0 commit comments

Comments
 (0)