@@ -1207,7 +1207,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
1207
1207
const isPercent = dim . width && dim . width . indexOf ( '%' ) !== - 1 ;
1208
1208
const isAuto = dim . width && dim . width . indexOf ( 'auto' ) !== - 1 ;
1209
1209
if ( isPercent ) {
1210
- return parseFloat ( dim . width ) / 100 * this . calcWidth ;
1210
+ return Math . round ( parseFloat ( dim . width ) / 100 * this . calcWidth ) ;
1211
1211
} else if ( isAuto ) {
1212
1212
return dim . autoWidth ;
1213
1213
} else {
@@ -1613,7 +1613,11 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
1613
1613
headers . push ( dimensionHeader ) ;
1614
1614
}
1615
1615
const autoWidth = this . getLargesContentWidth ( headers ) ;
1616
- dimension . width = autoWidth ;
1616
+ if ( dimension . width === "auto" ) {
1617
+ dimension . autoWidth = parseFloat ( autoWidth ) ;
1618
+ } else {
1619
+ dimension . width = autoWidth ;
1620
+ }
1617
1621
this . pipeTrigger ++ ;
1618
1622
this . cdr . detectChanges ( ) ;
1619
1623
}
@@ -2143,7 +2147,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2143
2147
ref . instance . headerTemplate = this . rowDimensionHeaderTemplate ;
2144
2148
ref . instance . resizable = this . rowDimensionResizing ;
2145
2149
ref . instance . sortable = dim . sortable === undefined ? true : dim . sortable ;
2146
- ref . instance . width = this . rowDimensionWidthToPixels ( dim ) + 'px' ;
2150
+ ref . instance . width = this . rowDimensionWidth ( dim ) ;
2147
2151
ref . changeDetectorRef . detectChanges ( ) ;
2148
2152
columns . push ( ref . instance ) ;
2149
2153
} ) ;
@@ -2162,8 +2166,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2162
2166
2163
2167
protected autoSizeDimensionsInView ( ) {
2164
2168
if ( ! this . hasDimensionsToAutosize ) return ;
2165
- for ( const dim of this . rowDimensions ) {
2166
- if ( dim . width === 'auto' ) {
2169
+ for ( const dim of this . visibleRowDimensions ) {
2170
+ if ( dim . width === 'auto' && ! this . hasHorizontalLayout ) {
2167
2171
const contentWidths = [ ] ;
2168
2172
const relatedDims = PivotUtil . flatten ( [ dim ] ) . map ( x => x . memberName ) ;
2169
2173
const content = this . rowDimensionContentCollection . filter ( x => relatedDims . indexOf ( x . dimension . memberName ) !== - 1 ) ;
@@ -2176,6 +2180,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
2176
2180
}
2177
2181
const maxSize = Math . ceil ( Math . max ( ...contentWidths ) ) ;
2178
2182
dim . autoWidth = maxSize ;
2183
+ } else if ( dim . width === 'auto' ) {
2184
+ this . autoSizeRowDimension ( dim ) ;
2179
2185
}
2180
2186
}
2181
2187
}
0 commit comments