@@ -465,13 +465,15 @@ PivotView.prototype.recalculateSizes = function (container) {
465
465
}
466
466
467
467
var pagedHeight = this . pagination . on ? this . PAGINATION_BLOCK_HEIGHT : 0 ,
468
- headerW = leftHeader . offsetWidth ,
468
+ headerW = Math . max ( leftHeader . offsetWidth , headerContainer . offsetWidth ) ,
469
469
headerH = topHeader . offsetHeight ,
470
470
containerHeight = container . offsetHeight ,
471
471
bodyHeight = containerHeight - headerH - pagedHeight ,
472
472
mainHeaderWidth = headerContainer . offsetWidth ,
473
- hasVerticalScrollBar = lTableHead . offsetHeight > bodyHeight
473
+ hasVerticalScrollBar =
474
+ Math . max ( lTableHead . offsetHeight , pTableHead . offsetHeight ) > bodyHeight
474
475
&& this . SCROLLBAR_WIDTH > 0 ,
476
+ addEggs = hasVerticalScrollBar && lTableHead . offsetHeight > 0 ,
475
477
cell , tr , cellWidths = [ ] , columnHeights = [ ] , i ;
476
478
477
479
headerContainer . style . width = headerW + "px" ;
@@ -517,7 +519,7 @@ PivotView.prototype.recalculateSizes = function (container) {
517
519
container [ "_primaryColumns" ] [ i ] . style . width = cellWidths [ i ] + "px" ;
518
520
}
519
521
520
- if ( hasVerticalScrollBar ) { // horScroll?
522
+ if ( addEggs ) { // horScroll?
521
523
tr = document . createElement ( "tr" ) ;
522
524
tr . appendChild ( cell = document . createElement ( "th" ) ) ;
523
525
lTableHead . appendChild ( tr ) ;
@@ -668,12 +670,20 @@ PivotView.prototype.renderRawData = function (data) {
668
670
tr . appendChild (
669
671
th = document . createElement ( rawData [ y ] [ x ] . isCaption ? "th" : "td" )
670
672
) ;
671
- th . textContent = rawData [ y ] [ x ] . value || " " ;
673
+ if ( rawData [ y ] [ x ] . value ) {
674
+ th . textContent = rawData [ y ] [ x ] . value ;
675
+ } else th . innerHTML = "‌" ;
672
676
if ( rawData [ y ] [ x ] . style ) th . setAttribute ( "style" , rawData [ y ] [ x ] . style ) ;
673
677
if ( info . leftHeaderColumnsNumber === 0
674
678
&& _ . controller . CONFIG [ "listingColumnMinWidth" ] ) { // if listing
675
679
th . style . minWidth = _ . controller . CONFIG [ "listingColumnMinWidth" ] + "px" ;
676
680
}
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
+ }
677
687
if ( rawData [ y ] [ x ] . className ) th . className = rawData [ y ] [ x ] . className ;
678
688
if ( rawData [ y ] [ x ] . group ) renderedGroups [ rawData [ y ] [ x ] . group ] = {
679
689
x : x ,
@@ -727,6 +737,13 @@ PivotView.prototype.renderRawData = function (data) {
727
737
_ . _backClickHandler . call ( _ , e ) ;
728
738
} ) ;
729
739
}
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
+ }
730
747
if ( // hide unnecessary column
731
748
( this . controller . CONFIG [ "hideButtons" ] || this . tablesStack . length < 2 )
732
749
&& info . leftHeaderColumnsNumber === 0
0 commit comments