SpreadJS Documentation
getNamedStyles Method
Gets named styles from Spread.
Syntax
var instance = new GcSpread.Sheets.Spread(host, options);
var value; // Type: Array
value = instance.getNamedStyles();
function getNamedStyles() : Array;

Return Value

The GcSpread.Sheets.Style array of named styles.
Example
This example uses the getNamedStyles method.
var namedStyle1 = new GcSpread.Sheets.Style();
namedStyle1.name = "style2";
namedStyle1.backColor = "blue";

var namedStyle = new GcSpread.Sheets.Style();
namedStyle.name = "style1";
namedStyle.backColor = "green";
spread.addNamedStyle(namedStyle);
spread.addNamedStyle(namedStyle1);
activeSheet.setStyleName(1, 1, "style1"); 
activeSheet.setStyleName(2, 1, "style1");
 activeSheet.setStyleName(3, 0, "style2");
activeSheet.getCell(1,1).value("test");

var sname = spread.getNamedStyles();
for(var i = 0; i < sname.length; i++){
alert(sname[i].name);
}
See Also

Reference

Spread type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.