@@ -797,7 +797,7 @@ PivotView.prototype.recalculateSizes = function (container) {
797
797
}
798
798
799
799
var addEggs = hasVerticalScrollBar && ! IS_LISTING ,
800
- cell , tr , cellWidths = [ ] , columnHeights = [ ] , i ,
800
+ cell , tr , cellWidths = [ ] , rowHeadersHeights = [ ] , rowDataHeights = [ ] , i ,
801
801
headerCellApplied = false ;
802
802
803
803
var applyExtraTopHeadCell = function ( ) {
@@ -826,9 +826,12 @@ PivotView.prototype.recalculateSizes = function (container) {
826
826
} else {
827
827
console . warn ( "No _primaryColumns property in container, cell sizes won't be fixed." ) ;
828
828
}
829
- if ( container [ "_primaryRows" ] ) {
829
+ if ( container [ "_primaryRows" ] && container [ "_primaryCells" ] ) {
830
830
for ( i in container [ "_primaryRows" ] ) {
831
- columnHeights . push ( container [ "_primaryRows" ] [ i ] . offsetHeight ) ;
831
+ rowHeadersHeights . push ( container [ "_primaryRows" ] [ i ] . offsetHeight ) ;
832
+ }
833
+ for ( i in container [ "_primaryCells" ] ) {
834
+ rowDataHeights . push ( container [ "_primaryCells" ] [ i ] . offsetHeight ) ;
832
835
}
833
836
} else {
834
837
console . warn ( "No _primaryRows property in container, cell sizes won't be fixed." ) ;
@@ -902,14 +905,24 @@ PivotView.prototype.recalculateSizes = function (container) {
902
905
if ( tableTr . childNodes [ i ] . tagName !== "TD" ) continue ;
903
906
tableTr . childNodes [ i ] . style . width = cellWidths [ i ] + "px" ;
904
907
}
905
- for ( i in pTableHead . childNodes ) {
906
- if ( pTableHead . childNodes [ i ] . tagName !== "TR" ) continue ;
907
- if ( pTableHead . childNodes [ i ] . firstChild ) {
908
- pTableHead . childNodes [ i ] . firstChild . style . height =
909
- ( columnHeights [ i ] || columnHeights [ i - 1 ] || DEFAULT_CELL_HEIGHT )
910
- + "px" ;
911
- }
912
- }
908
+ //for (i in pTableHead.childNodes) {
909
+ // if (pTableHead.childNodes[i].tagName !== "TR") continue;
910
+ // if (pTableHead.childNodes[i].firstChild) {
911
+ // pTableHead.childNodes[i].firstChild.style.height =
912
+ // Math.max(
913
+ // (rowHeadersHeights[i] || rowHeadersHeights[i - 1] || DEFAULT_CELL_HEIGHT),
914
+ // (rowDataHeights[i] || rowDataHeights[i - 1] || DEFAULT_CELL_HEIGHT)
915
+ // ) + "px";
916
+ //
917
+ // }
918
+ //}
919
+ container [ "_primaryRows" ] . forEach ( function ( val , i ) {
920
+ container [ "_primaryCells" ] [ i ] . style . height =
921
+ container [ "_primaryRows" ] [ i ] . style . height = Math . max (
922
+ rowHeadersHeights [ i ] || rowHeadersHeights [ i - 1 ] || DEFAULT_CELL_HEIGHT ,
923
+ rowDataHeights [ i ] || rowDataHeights [ i - 1 ] || DEFAULT_CELL_HEIGHT
924
+ ) + "px" ;
925
+ } ) ;
913
926
914
927
// #keepSizes
915
928
keepSizes . forEach ( function ( o ) {
@@ -1071,8 +1084,8 @@ PivotView.prototype.renderRawData = function (data) {
1071
1084
} ) ( ) : null ,
1072
1085
1073
1086
renderedGroups = { } , // keys of rendered groups; key = group, value = { x, y, element }
1074
- i , x , y , tr = null , th , td , primaryColumns = [ ] , primaryRows = [ ] , ratio , cellStyle ,
1075
- tempI , tempJ , div ;
1087
+ i , x , y , tr = null , th , td , primaryColumns = [ ] , primaryRows = [ ] , primaryCells = [ ] ,
1088
+ ratio , cellStyle , tempI , tempJ , div ;
1076
1089
1077
1090
this . SEARCH_ENABLED = SEARCH_ENABLED ;
1078
1091
@@ -1273,7 +1286,7 @@ PivotView.prototype.renderRawData = function (data) {
1273
1286
}
1274
1287
1275
1288
// add listeners
1276
- if ( vertical && x === xTo - 1 && ! rawData [ y ] [ x ] [ "noDrillDown" ] ) {
1289
+ if ( vertical && x === xTo - 1 ) {
1277
1290
primaryRows . push ( th ) ;
1278
1291
th . addEventListener ( CLICK_EVENT , ( function ( index , data ) {
1279
1292
return function ( ) {
@@ -1360,6 +1373,7 @@ PivotView.prototype.renderRawData = function (data) {
1360
1373
cellStyle = this . controller . getPivotProperty ( [ "cellStyle" ] ) || "" ;
1361
1374
tr . appendChild ( td = document . createElement ( "td" ) ) ;
1362
1375
td . appendChild ( div = document . createElement ( "div" ) ) ;
1376
+ if ( x === info . leftHeaderColumnsNumber ) primaryCells . push ( td ) ;
1363
1377
formatContent (
1364
1378
rawData [ y ] [ x ] . value ,
1365
1379
div ,
@@ -1549,6 +1563,7 @@ PivotView.prototype.renderRawData = function (data) {
1549
1563
1550
1564
container [ "_primaryColumns" ] = primaryColumns ;
1551
1565
container [ "_primaryRows" ] = primaryRows ;
1566
+ container [ "_primaryCells" ] = primaryCells ;
1552
1567
container [ "_listing" ] = LISTING ;
1553
1568
1554
1569
this . recalculateSizes ( container ) ;
0 commit comments