@@ -465,13 +465,15 @@ PivotView.prototype.recalculateSizes = function (container) {
465465 }
466466
467467 var pagedHeight = this . pagination . on ? this . PAGINATION_BLOCK_HEIGHT : 0 ,
468- headerW = leftHeader . offsetWidth ,
468+ headerW = Math . max ( leftHeader . offsetWidth , headerContainer . offsetWidth ) ,
469469 headerH = topHeader . offsetHeight ,
470470 containerHeight = container . offsetHeight ,
471471 bodyHeight = containerHeight - headerH - pagedHeight ,
472472 mainHeaderWidth = headerContainer . offsetWidth ,
473- hasVerticalScrollBar = lTableHead . offsetHeight > bodyHeight
473+ hasVerticalScrollBar =
474+ Math . max ( lTableHead . offsetHeight , pTableHead . offsetHeight ) > bodyHeight
474475 && this . SCROLLBAR_WIDTH > 0 ,
476+ addEggs = hasVerticalScrollBar && lTableHead . offsetHeight > 0 ,
475477 cell , tr , cellWidths = [ ] , columnHeights = [ ] , i ;
476478
477479 headerContainer . style . width = headerW + "px" ;
@@ -517,7 +519,7 @@ PivotView.prototype.recalculateSizes = function (container) {
517519 container [ "_primaryColumns" ] [ i ] . style . width = cellWidths [ i ] + "px" ;
518520 }
519521
520- if ( hasVerticalScrollBar ) { // horScroll?
522+ if ( addEggs ) { // horScroll?
521523 tr = document . createElement ( "tr" ) ;
522524 tr . appendChild ( cell = document . createElement ( "th" ) ) ;
523525 lTableHead . appendChild ( tr ) ;
@@ -668,12 +670,20 @@ PivotView.prototype.renderRawData = function (data) {
668670 tr . appendChild (
669671 th = document . createElement ( rawData [ y ] [ x ] . isCaption ? "th" : "td" )
670672 ) ;
671- th . textContent = rawData [ y ] [ x ] . value || " " ;
673+ if ( rawData [ y ] [ x ] . value ) {
674+ th . textContent = rawData [ y ] [ x ] . value ;
675+ } else th . innerHTML = "‌" ;
672676 if ( rawData [ y ] [ x ] . style ) th . setAttribute ( "style" , rawData [ y ] [ x ] . style ) ;
673677 if ( info . leftHeaderColumnsNumber === 0
674678 && _ . controller . CONFIG [ "listingColumnMinWidth" ] ) { // if listing
675679 th . style . minWidth = _ . controller . CONFIG [ "listingColumnMinWidth" ] + "px" ;
676680 }
681+ if ( info . leftHeaderColumnsNumber > 0
682+ && _ . controller . CONFIG [ "maxHeaderWidth" ] ) {
683+ th . style . maxWidth = _ . controller . CONFIG [ "maxHeaderWidth" ] + "px" ;
684+ th . style . whiteSpace = "normal" ;
685+ th . style . wordWrap = "normal" ;
686+ }
677687 if ( rawData [ y ] [ x ] . className ) th . className = rawData [ y ] [ x ] . className ;
678688 if ( rawData [ y ] [ x ] . group ) renderedGroups [ rawData [ y ] [ x ] . group ] = {
679689 x : x ,
@@ -727,6 +737,13 @@ PivotView.prototype.renderRawData = function (data) {
727737 _ . _backClickHandler . call ( _ , e ) ;
728738 } ) ;
729739 }
740+ if ( info . leftHeaderColumnsNumber > 0
741+ && _ . controller . CONFIG [ "maxHeaderWidth" ] ) {
742+ pivotHeader . style . maxWidth =
743+ _ . controller . CONFIG [ "maxHeaderWidth" ] * info . leftHeaderColumnsNumber + "px" ;
744+ pivotHeader . style . whiteSpace = "normal" ;
745+ pivotHeader . style . wordWrap = "normal" ;
746+ }
730747 if ( // hide unnecessary column
731748 ( this . controller . CONFIG [ "hideButtons" ] || this . tablesStack . length < 2 )
732749 && info . leftHeaderColumnsNumber === 0
0 commit comments