SpreadJS 13
GC.Spread.Commands Namespace / CommandManager class / execute Method
The options for the command.
The command name, the field is required.
The command argument, the name and type are decided by the command definition.
The command argument, the name and type are decided by the command definition.
The command argument, the name and type are decided by the command definition.
In This Topic
    execute Method
    In This Topic
    Executes a command and adds the command to UndoManager.
    Syntax
    var instance = new GC.Spread.Commands.CommandManager(context);
    var value; // Type: boolean
    value = instance.execute(commandOptions,
                             commandOptions.cmd,
                             commandOptions.arg1,
                             commandOptions.arg2,
                             commandOptions.argN);
    function execute( 
       commandOptions : Object,
       commandOptions.cmd : string,
       (optional) commandOptions.arg1 : Object,
       (optional) commandOptions.arg2 : Object,
       (optional) commandOptions.argN : Object
    ) : boolean;

    Parameters

    commandOptions
    The options for the command.
    commandOptions.cmd
    The command name, the field is required.
    commandOptions.arg1
    The command argument, the name and type are decided by the command definition.
    commandOptions.arg2
    The command argument, the name and type are decided by the command definition.
    commandOptions.argN
    The command argument, the name and type are decided by the command definition.

    Return Value

    The execute command result.
    Example
    //For example, the following code executes the autoFitColumn command.
    var spread = GC.Spread.Sheets.findControl(document.getElementById("ss"));
    spread.commandManager().execute({cmd: "autoFitColumn", sheetName: "Sheet1", columns: [{col: 1}], rowHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell});
    See Also