SpreadJS Documentation
copyFrom Method
The source style.
Copies settings from another style to 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.copyFrom(style);
function copyFrom( 
   style : Style
) : any;

Parameters

style
The source style.
Example
This example copies and uses a style.
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.copyFrom(style);
activeSheet.setStyle(1,3,style2,GcSpread.Sheets.SheetArea.viewport);
Remarks
Settings from the style that is being copied from (source style), replace similar settings in the style that is being copied to.
See Also

Reference

Style class

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.