@@ -374,21 +374,25 @@ DataController.prototype.resetRawData = function () {
374374 if ( ! _ . controller . CONFIG [ "pivotProperties" ] ) return rawData ;
375375 var x , y , i , xEnd = rawData [ 0 ] . length ,
376376 colLevels = _ . controller . getPivotProperty ( [ "columnLevels" ] ) ,
377+ rowLevels = _ . controller . getPivotProperty ( [ "rowLevels" ] ) ,
377378 formatColumn = {
378379 // "<spec>": { style: "<style>" }
379380 } ;
380381 var fillLevels = function ( obj ) {
381382 if ( typeof obj === "undefined" ) return ;
382383 for ( var i in obj [ "childLevels" ] ) {
383- if ( obj [ "childLevels" ] [ i ] [ "spec" ] && obj [ "childLevels" ] [ i ] [ "levelStyle" ] ) {
384- formatColumn [ obj [ "childLevels" ] [ i ] [ "spec" ] ] =
385- { style : obj [ "childLevels" ] [ i ] [ "levelStyle" ] } ;
384+ if ( obj [ "childLevels" ] [ i ] && obj [ "childLevels" ] [ i ] [ "spec" ] ) {
385+ formatColumn [ ( obj [ "childLevels" ] [ i ] [ "spec" ] || "" ) . replace ( / [ ^ . ] * $ / , "" ) ] = {
386+ style : obj [ "childLevels" ] [ i ] [ "levelStyle" ] || "" ,
387+ headStyle : obj [ "childLevels" ] [ i ] [ "levelHeaderStyle" ] || ""
388+ } ;
386389 }
387390 fillLevels ( obj [ "childLevels" ] [ i ] ) ;
388391 }
389392 } ;
390393 for ( i in colLevels ) {
391- fillLevels ( colLevels [ i ] ) ;
394+ fillLevels ( { childLevels : [ colLevels [ i ] ] } ) ;
395+ fillLevels ( { childLevels : [ rowLevels [ i ] ] } ) ;
392396 }
393397 for ( y = 0 ; y < rawData . length ; y ++ ) {
394398 for ( x = 0 ; x < xEnd ; x ++ ) {
@@ -398,10 +402,14 @@ DataController.prototype.resetRawData = function () {
398402 if ( rawData [ y ] [ x ] . source && rawData [ y ] [ x ] . source [ "path" ] ) {
399403 for ( i in formatColumn ) {
400404 if ( rawData [ y ] [ x ] . source [ "path" ] . indexOf ( i ) >= 0 ) {
401- for ( var yy = y + 1 ; yy < rawData . length ; yy ++ ) {
405+ var yy ;
406+ for ( yy = y ; yy < rawData . length ; yy ++ ) {
402407 if ( ! rawData [ yy ] [ x ] . isCaption ) {
403- rawData [ yy ] [ x ] . style = ( rawData [ yy ] [ x ] . style || "" )
408+ if ( formatColumn [ i ] . style ) rawData [ yy ] [ x ] . style = ( rawData [ yy ] [ x ] . style || "" )
404409 + formatColumn [ i ] . style || "" ;
410+ } else {
411+ if ( formatColumn [ i ] . headStyle ) rawData [ yy ] [ x ] . style = ( rawData [ yy ] [ x ] . style || "" )
412+ + formatColumn [ i ] . headStyle || "" ;
405413 }
406414 }
407415 break ;
0 commit comments