SpreadJS 13
GC.Spread.Sheets.CellTypes Namespace / HyperLink class / onClickAction Method
The callback of the hyperlink.
In This Topic
    onClickAction Method
    In This Topic
    Gets or sets the callback of the hyperlink, If execute the function will represent the context for the callback.
    Syntax
    var instance = new GC.Spread.Sheets.CellTypes.HyperLink();
    var returnValue; // Type: any
    returnValue = instance.onClickAction(value);
    function onClickAction( 
       value : Function
    ) : any;

    Parameters

    value
    The callback of the hyperlink.

    Return Value

    If no value is set, return a value that indicates the callback of the hyperlink; otherwise, returns the hyperlink cell type.
    Example
    //This example sets the tab color when selecting the hyperlink.
    var h2 = new GC.Spread.Sheets.CellTypes.HyperLink();
    h2.text("set sheet tab style");
    h2.linkToolTip("set sheet tab style");
    h2.linkColor("blue");
    h2.visitedLinkColor("#FF2235");
    activeSheet.getCell(2, 1).cellType(h2).value("set sheet tab style").hAlign(GC.Spread.Sheets.HorizontalAlign.center);
    h2.activeOnClick(true);
                h2.onClickAction(function () {
                    var setSheetTabColor = {
                        canUndo: true,
                        execute: function (context, options, isUndo) {
                            activeSheet.name("Hyperlink");
                            activeSheet.options.sheetTabColor = "red";
                        }
                    };
                    var commandManager = spread.commandManager();
                    var commandName = "setSheetTabStyle";
                    commandManager.register(commandName, setSheetTabColor, null, false, false, false, false);
                    commandManager.execute({cmd: commandName})
                });
    See Also

    Reference

    HyperLink class