Skip to content

Commit 3923531

Browse files
Svetoslav KrastevSvetoslav Krastev
authored andcommitted
fix(pivotGrid): Apply dimension with to pivot calcWidth.
1 parent 9861f2c commit 3923531

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="igx-grid__tbody-content" tabindex="0" [attr.role]="dataView.length ? null : 'row'" (keydown)="navigation.handleNavigation($event)" (focus)="navigation.focusTbody($event)"
2424
(dragStop)="selectionService.dragMode = $event" (scroll)='preventContainerScroll($event)'
2525
(dragScroll)="dragScroll($event)" [igxGridDragSelect]="selectionService.dragMode"
26-
[style.height.px]='totalHeight' [style.width.px]='calcWidth || null' #tbody [attr.aria-activedescendant]="activeDescendant">
26+
[style.height.px]='totalHeight' [style.width.px]='pivotContentCalcWidth || null' #tbody [attr.aria-activedescendant]="activeDescendant">
2727
<span *ngIf="hasMovableColumns && columnInDrag && pinnedColumns.length <= 0"
2828
[igxColumnMovingDrop]="headerContainer" [attr.droppable]="true" id="left"
2929
class="igx-grid__scroll-on-drag-left"></span>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,11 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
11551155
return (width * 100 / this.calcWidth);
11561156
}
11571157

1158+
public get pivotContentCalcWidth() {
1159+
const totalDimWidth = this.rowDimensions.map((dim) => this.rowDimensionWidthToPixels(dim)).reduce((prev, cur) => prev + cur);
1160+
return this.calcWidth - totalDimWidth;
1161+
}
1162+
11581163
public get rowDimensions() {
11591164
return this.pivotConfiguration.rows?.filter(x => x.enabled) || [];
11601165
}
@@ -1930,7 +1935,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
19301935
const expressions = flattenedColumnsWithSorting.length > 0? PivotSortUtil.generateDimensionSortingExpressions(flattenedColumnsWithSorting) : [];
19311936
let sortedData = data;
19321937
if (expressions.length > 0) {
1933-
sortedData = DataUtil.sort(cloneArray(data), expressions, this.sortStrategy, this);
1938+
sortedData = DataUtil.sort(cloneArray(data), expressions, this.sortStrategy, this);
19341939
}
19351940
let fieldsMap;
19361941
if (this.pivotConfiguration.columnStrategy && this.pivotConfiguration.columnStrategy instanceof NoopPivotDimensionsStrategy) {

0 commit comments

Comments
 (0)