SpreadJS Documentation
getCustomName Method
The custom name.
Gets the specified custom name information.
Syntax
var instance = new GcSpread.Sheets.Spread(host, options);
var value; // Type: NameInfo
value = instance.getCustomName(name);
function getCustomName( 
   name : string
) : NameInfo;

Parameters

name
The custom name.

Return Value

The information for the specified custom name.
Example
This example uses the getCustomName method.
activeSheet.setValue(0, 0, 1);
activeSheet.setValue(0, 1, 2);
activeSheet.setValue(0, 2, 3);
spread.addCustomName("customName1","=12", 0, 0);
activeSheet.setFormula(1, 0, "customName1");

var cname = spread.getCustomName("customName1");
    if (cname instanceof GcSpread.Sheets.NameInfo) {
        //get CustomName
        var name = cname.getName();
        //get Expression
        var expression = cname.getExpression();
        //get Expression String
        var expStr = new GcSpread.Sheets.Calc.Parser().unparse(expression, new GcSpread.Sheets.Calc.ParserContext(true, 0, 0));
        alert("Name:" + name + ";Expression: =" + expStr);
}
See Also

Reference

Spread type
Creating Custom Names

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.