SpreadJS Documentation
compose Method
The source style.
Whether to force composing.
Composes settings from another style for the current style.
Syntax
var instance = new GcSpread.Sheets.Style(backColor,
                                        foreColor,
                                        hAlign,
                                        vAlign,
                                        font,
                                        themeFont,
                                        formatter,
                                        borderLeft,
                                        borderTop,
                                        borderRight,
                                        borderBottom,
                                        locked,
                                        textIndent,
                                        wordWrap,
                                        shrinkToFit,
                                        backgroundImage,
                                        cellType,
                                        backgroundImageLayout,
                                        tabStop,
                                        textDecoration,
                                        imeMode,
                                        name,
                                        parentName,
                                        watermark);
var value; // Type: any
value = instance.compose(style, force);
function compose( 
   style : Style,
   force : boolean
) : any;

Parameters

style
The source style.
force
Whether to force composing.
Example
This example combines two styles.
var style = new GcSpread.Sheets.Style();
style.backColor = "lightgreen";
style.foreColor = "red";
activeSheet.setStyle(1,1,style,GcSpread.Sheets.SheetArea.viewport);

var style2 = new GcSpread.Sheets.Style();
style2.foreColor = "black";
style2.compose(style, false);
activeSheet.setStyle(1,3,style2,GcSpread.Sheets.SheetArea.viewport);
Remarks
Style settings from the source style do not replace similar settings in the current style.
See Also

Reference

Style class

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.