@@ -1207,7 +1207,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
12071207 const isPercent = dim . width && dim . width . indexOf ( '%' ) !== - 1 ;
12081208 const isAuto = dim . width && dim . width . indexOf ( 'auto' ) !== - 1 ;
12091209 if ( isPercent ) {
1210- return parseFloat ( dim . width ) / 100 * this . calcWidth ;
1210+ return Math . round ( parseFloat ( dim . width ) / 100 * this . calcWidth ) ;
12111211 } else if ( isAuto ) {
12121212 return dim . autoWidth ;
12131213 } else {
@@ -1613,7 +1613,11 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
16131613 headers . push ( dimensionHeader ) ;
16141614 }
16151615 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+ }
16171621 this . pipeTrigger ++ ;
16181622 this . cdr . detectChanges ( ) ;
16191623 }
@@ -2143,7 +2147,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
21432147 ref . instance . headerTemplate = this . rowDimensionHeaderTemplate ;
21442148 ref . instance . resizable = this . rowDimensionResizing ;
21452149 ref . instance . sortable = dim . sortable === undefined ? true : dim . sortable ;
2146- ref . instance . width = this . rowDimensionWidthToPixels ( dim ) + 'px' ;
2150+ ref . instance . width = this . rowDimensionWidth ( dim ) ;
21472151 ref . changeDetectorRef . detectChanges ( ) ;
21482152 columns . push ( ref . instance ) ;
21492153 } ) ;
@@ -2162,8 +2166,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
21622166
21632167 protected autoSizeDimensionsInView ( ) {
21642168 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 ) {
21672171 const contentWidths = [ ] ;
21682172 const relatedDims = PivotUtil . flatten ( [ dim ] ) . map ( x => x . memberName ) ;
21692173 const content = this . rowDimensionContentCollection . filter ( x => relatedDims . indexOf ( x . dimension . memberName ) !== - 1 ) ;
@@ -2176,6 +2180,8 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
21762180 }
21772181 const maxSize = Math . ceil ( Math . max ( ...contentWidths ) ) ;
21782182 dim . autoWidth = maxSize ;
2183+ } else if ( dim . width === 'auto' ) {
2184+ this . autoSizeRowDimension ( dim ) ;
21792185 }
21802186 }
21812187 }
0 commit comments