@@ -434,13 +434,22 @@ DataController.prototype.resetRawData = function () {
434
434
435
435
} ;
436
436
437
- var applyHeaderStyle = function ( cellObject , isHorizontal ) {
437
+ var applyHeaderStyle = function ( cellObject , isHorizontal , previousHeaders ) {
438
438
if ( ! _ . controller . CONFIG [ "pivotProperties" ] ) return ;
439
439
if ( _ . controller . CONFIG [ "pivotProperties" ] [ "columnHeaderStyle" ] && isHorizontal ) {
440
- cellObject . style = _ . controller . CONFIG [ "pivotProperties" ] [ "columnHeaderStyle" ] ;
440
+ cellObject . style =
441
+ _ . controller . CONFIG [ "pivotProperties" ] [ "columnHeaderStyle" ] + cellObject . style ;
441
442
} else if ( _ . controller . CONFIG [ "pivotProperties" ] [ "rowHeaderStyle" ] && ! isHorizontal ) {
442
- cellObject . style = _ . controller . CONFIG [ "pivotProperties" ] [ "rowHeaderStyle" ] ;
443
+ cellObject . style =
444
+ _ . controller . CONFIG [ "pivotProperties" ] [ "rowHeaderStyle" ] + cellObject . style ;
443
445
}
446
+ if ( typeof previousHeaders === "undefined" )
447
+ return ;
448
+ var prevStyles = previousHeaders . reduce (
449
+ function ( acc , h ) { return acc + ( h . style || "" ) } , ""
450
+ ) ;
451
+ if ( prevStyles )
452
+ cellObject . style += prevStyles ;
444
453
} ;
445
454
446
455
var getMaxLevel = function ( children , level ) {
@@ -489,18 +498,20 @@ DataController.prototype.resetRawData = function () {
489
498
group : cnum ,
490
499
source : c [ i ] ,
491
500
isCaption : true ,
492
- value : c [ i ] . caption || ""
501
+ value : c [ i ] . caption || "" ,
502
+ style : c [ i ] . style || ""
493
503
} ;
494
- applyHeaderStyle ( obj , hor ) ;
504
+ applyHeaderStyle ( obj , hor , arr ) ;
495
505
dim1raw ( a , c [ i ] . children , arr . concat ( obj ) , hor , level ? level + 1 : level , maxLevel ) ;
496
506
} else {
497
507
obj = {
498
508
group : groupNum ,
499
509
source : c [ i ] ,
500
510
isCaption : true ,
501
- value : c [ i ] . caption || ""
511
+ value : c [ i ] . caption || "" ,
512
+ style : c [ i ] . style || ""
502
513
} ;
503
- applyHeaderStyle ( obj , hor ) ;
514
+ applyHeaderStyle ( obj , hor , arr ) ;
504
515
a . push ( c [ i ] [ "type" ] === "msr" && MEASURES_HIDDEN ? arr : arr . concat ( obj ) ) ;
505
516
groupNum ++ ;
506
517
}
0 commit comments