SpreadJS Documentation
GC.Spread.Sheets Namespace / Workbook type / getCustomName Method
The custom name.
In This Topic
    getCustomName Method
    In This Topic
    Gets the specified custom name information.
    Syntax
    var instance = new GC.Spread.Sheets.Workbook(host,
                                                options,
                                                options.sheetCount,
                                                options.font,
                                                options.allowUserDragMerge,
                                                options.allowUserDragDrop,
                                                options.allowUserDragFill,
                                                options.allowUserZoom,
                                                options.allowUserResize,
                                                options.allowUndo,
                                                options.allowSheetReorder,
                                                options.allowContextMenu,
                                                options.allowUserDeselect,
                                                options.defaultDragFillType,
                                                options.showDragFillSmartTag,
                                                options.showHorizontalScrollbar,
                                                options.showVerticalScrollbar,
                                                options.scrollbarShowMax,
                                                options.scrollbarMaxAlign,
                                                options.tabStripVisible,
                                                options.tabStripRatio,
                                                options.tabEditable,
                                                options.newTabVisible,
                                                options.tabNavigationVisible,
                                                options.cutCopyIndicatorVisible,
                                                options.cutCopyIndicatorBorderColor,
                                                options.backColor,
                                                options.backgroundImage,
                                                options.backgroundImageLayout,
                                                options.grayAreaBackColor,
                                                options.showResizeTip,
                                                options.showDragDropTip,
                                                options.showDragFillTip,
                                                options.showScrollTip,
                                                options.scrollIgnoreHidden,
                                                options.highlightInvalidData,
                                                options.useTouchLayout,
                                                options.hideSelection,
                                                options.resizeZeroIndicator,
                                                options.allowUserEditFormula,
                                                options.enableFormulaTextbox,
                                                options.autoFitType,
                                                options.referenceStyle,
                                                options.calcOnDemand,
                                                options.allowCopyPasteExcelStyle,
                                                options.allowExtendPasteRange,
                                                options.copyPasteHeaderOptions,
                                                options.scrollByPixel,
                                                options.scrollPixel,
                                                options.customList);
    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 GC.Spread.Sheets.NameInfo) {
            //get CustomName
            var name = cname.getName();
            //get Expression
            var expression = cname.getExpression();
            //get Expression String
            var expStr = GC.Spread.Sheets.CalcEngine.expressionToFormula(activeSheet, expression, 0, 0);
            alert("Name:" + name + ";Expression: =" + expStr);
    }
    See Also