Skip to content

Commit 2978616

Browse files
Svetoslav KrastevSvetoslav Krastev
authored andcommitted
fix(pivot-grid): Defer assignng width to pivot elements after columns have been generated.
1 parent 3907d87 commit 2978616

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
</div>
8282

8383
<div class="igx-grid__scroll" [style.height.px]="scrollSize" #scr [hidden]="isHorizontalScrollHidden" (pointerdown)="$event.preventDefault()">
84-
<div class="igx-grid__scroll-start" [style.width.px]='isPinningToStart ? pinnedWidth : headerFeaturesWidth' [style.min-width.px]='isPinningToStart ? pinnedWidth : headerFeaturesWidth'></div>
85-
<div class="igx-grid__scroll-main" [style.width.px]='unpinnedWidth'>
84+
<div class="igx-grid__scroll-start" [style.width.px]='pivotPinnedWidth' [style.min-width.px]='pivotPinnedWidth'></div>
85+
<div class="igx-grid__scroll-main" [style.width.px]='pivotUnpinnedWidth'>
8686
<ng-template igxGridFor [igxGridForOf]='EMPTY_DATA' #scrollContainer>
8787
</ng-template>
8888
</div>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,10 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
11361136
* @hidden @internal
11371137
*/
11381138
public rowDimensionWidthToPixels(dim: IPivotDimension): number {
1139+
if (this.shouldGenerate) {
1140+
return 0;
1141+
}
1142+
11391143
if (!dim.width) {
11401144
return MINIMUM_COLUMN_WIDTH;
11411145
}
@@ -1161,6 +1165,14 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
11611165
return this.calcWidth - totalDimWidth;
11621166
}
11631167

1168+
public get pivotPinnedWidth() {
1169+
return !this.shouldGenerate ? (this.isPinningToStart ? this.pinnedWidth : this.headerFeaturesWidth) : 0;
1170+
}
1171+
1172+
public get pivotUnpinnedWidth() {
1173+
return !this.shouldGenerate ? this.unpinnedWidth : 0;
1174+
}
1175+
11641176
public get rowDimensions() {
11651177
return this.pivotConfiguration.rows?.filter(x => x.enabled) || [];
11661178
}

0 commit comments

Comments
 (0)