Spread.Sheets Documentation
execute Method
The options for the command.
* commandOptions.cmd {string} The command name, the field is required.
* commandOptions.arg1 {Object} The command argument, the name and type are decided by the command definition.
* commandOptions.arg2 {Object} The command argument, the name and type are decided by the command definition.
* commandOptions.argN {Object} The command argument, the name and type are decided by the command definition.
* * 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});
Executes a command and adds the command to UndoManager.
Syntax
var instance = new GC.Spread.Commands.CommandManager(context);
var value; // Type: string
value = instance.execute(commandOptions);
function execute( 
   commandOptions : Object
) : string;

Parameters

commandOptions
The options for the command.
* commandOptions.cmd {string} The command name, the field is required.
* commandOptions.arg1 {Object} The command argument, the name and type are decided by the command definition.
* commandOptions.arg2 {Object} The command argument, the name and type are decided by the command definition.
* commandOptions.argN {Object} The command argument, the name and type are decided by the command definition.
* * 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});

Return Value

The execute command result.
See Also

Reference

CommandManager class

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.