[]
• DefineColumn: Object
Represents the command used to define the column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property [options.col] The specified col for inserting, optional.
property options.column The defined column.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the define column action.
// define the column properties
spread.commandManager().execute({cmd: "DefineColumn", sheetName: "Sheet1", { col: 1, column: { value: 'column1' }}});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col?: number ; column: IColumn ; sheetName: string }) => any |
• ModifyColumn: Object
Represents the command used to modify the column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.col The specified col.
property options.column The modified column.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the modify column action.
// modify the column properties
spread.commandManager().execute({cmd: "ModifyColumn", sheetName: "Sheet1", { col: 1, column: { value: 'column1' }}});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; column: IColumn ; sheetName: string }) => any |
• RemoveColumn: Object
Represents the command used to remove the column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.col The specified col.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the remove column action.
// remove the column properties
spread.commandManager().execute({cmd: "RemoveColumn", sheetName: "Sheet1", { col: 1 }});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; sheetName: string }) => any |
• ReportChartPreviewVisible: Object
Represents the command used to change the report chart preview visible in reportSheet cell binding chart.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.row The data chart row number.
property options.col The data chart column number.
property options.visible The data chart visible.
property isUndo true if this is an undo operation; otherwise, false.
example
// change the data chart preview visible in reportSheet while in Design mode with invoking command.
spread.commandManager().execute({cmd: "ReportChartPreviewVisible", sheetName: "Report1", row: 1, col: 1, visible: true});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetName: string ; visible: boolean }, isUndo: boolean) => boolean |
• ReportCollapseButtonToggle: Object
Represents the command used to toggle one collapse button in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.row The collapse button row.
property options.col The collapse button col.
property isUndo true if this is an undo operation; otherwise, false.
example
// toggle one collapse button with invoking command.
spread.commandManager().execute({cmd: "ReportCollapseButtonToggle", sheetName: "Report1", row: 1, col: 1});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetName: string }, isUndo: boolean) => boolean |
• autoFitColumn: Object
Represents the command used to automatically resize the column in a sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.columns The resize columns; each item is an object which has a col.
property options.rowHeader Whether the resized columns are in the row header area.
property options.autoFitType Whether the auto-fit action includes the header text.
property isUndo true if this is an undo operation; otherwise, false.
example
var columns = [ { col: 3 } ];
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "autoFitColumn", sheetName: "Sheet1", columns: columns, rowHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { autoFitType: AutoFitType ; columns: Object[] ; rowHeader: boolean ; sheetName: string }, isUndo: boolean) => any |
• autoFitRow: Object
Represents the command used to automatically resize the row in a sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.rows The resize rows; each item is an object which has a row.
property options.columnHeader Whether the resized rows are in the column header area.
property options.autoFitType Whether the auto-fit action includes the header text.
property isUndo true if this is an undo operation; otherwise, false.
example
spread.options.allowUndo = true;
var rows = [ { row: 3 } ];
spread.commandManager().execute({cmd: "autoFitRow", sheetName: "Sheet1", rows: rows, columnHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { autoFitType: AutoFitType ; columnHeader: boolean ; rows: Object[] ; sheetName: string }, isUndo: boolean) => any |
• cancelInput: Object
Represents the command used to stop cell editing and cancel input.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// stop cell editing with invoking command
// this sample will cancel the input editor after 2 Second
activeSheet.setValue(0, 0, '12312');
activeSheet.startEdit();
window.setTimeout(function() {
spread.commandManager().execute({ cmd: "cancelInput", sheetName: "Sheet1" });
}, 2000);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• changeEditorStatus: Object
Represents the command used to switch the editor status between enter and edit mode when a cell is editing.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// start editing a cell with invoking command
spread.commandManager().execute({cmd: "changeEditorStatus", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• changeFormulaReference: Object
Represents the command used to switch the formula reference between relative, absolute, and mixed when editing formulas.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
//This example uses the changeFormulaReference action to switch the formula reference.
spread.commandManager().execute({cmd: "changeFormulaReference", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• clear: Object
Represents the command used to clear the cell value.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// clear selected cells with the tab key
spread.commandManager().setShortcutKey('clear', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
// clear selected cells with invoking command
spread.commandManager().execute({cmd: "clear", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• clearAndEditing: Object
Represents the command used to clear the active cell value and enters edit mode.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// clear active cell and enter edit mode with invoking command
spread.commandManager().execute({cmd: "clearAndEditing", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• clearValues: Object
Represents the command used to clear cell values on a worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.ranges The clear cell value ranges whose item type is GC.Spread.Sheets.Range.
property isUndo true if this is an undo operation; otherwise, false.
example
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "clearValues", sheetName: "Sheet1", ranges: [new GC.Spread.Sheets.Range(8, 5, 2, 1)]});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { ranges: Range[] ; sheetName: string }, isUndo: boolean) => any |
• clipboardPaste: Object
Represents the command used for a Clipboard paste on the worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.fromSheet The source sheet.
property options.fromRanges The source range array which item type is GC.Spread.Sheets.Range.
property options.pastedRanges The target range array which item type is GC.Spread.Sheets.Range.
property options.isCutting Whether the operation is cutting or copying.
property options.clipboardText The text on the clipboard.
property options.pasteOption The Clipboard pasting option that indicates which content to paste.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the clipboardPaste method.
activeSheet.setValue(0, 0, 1, GC.Spread.Sheets.SheetArea.viewport);
activeSheet.setValue(1, 0, 2, GC.Spread.Sheets.SheetArea.viewport);
activeSheet.setFormula(2, 0, "=A1+A2", GC.Spread.Sheets.SheetArea.viewport);
activeSheet.setValue(0, 1, 3, GC.Spread.Sheets.SheetArea.viewport);
activeSheet.setValue(1, 1, 4, GC.Spread.Sheets.SheetArea.viewport);
activeSheet.setFormula(2, 1, "=B1+B2", GC.Spread.Sheets.SheetArea.viewport);
var fromRange = [new GC.Spread.Sheets.Range(0, 0, 3, 2)];
var toRanges = [new GC.Spread.Sheets.Range(5, 0, 3, 2)];
spread.commandManager().execute({cmd: "clipboardPaste", sheetName: "Sheet1", fromSheet: activeSheet, fromRanges: fromRange, pastedRanges: toRanges, isCutting: true, clipboardText: "", pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { clipboardText: string ; fromRanges: Range[] ; fromSheet: Worksheet ; isCutting: boolean ; pasteOption: ClipboardPasteOptions ; pastedRanges: Range[] ; sheetName: string }, isUndo: boolean) => any |
• commitArrayFormula: Object
Represents the command used to commit the cell editing and sets the array formula to the active range.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// commit the cell editing and sets the array formula to the active range with invoking command
spread.commandManager().execute({cmd: "commitArrayFormula", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• commitInputNavigationDown: Object
Represents the command used to stop cell editing and moves the active cell to the next row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// stop cell editing and moves the active cell to the next row with invoking command
activeSheet.setValue(1, 1, '12312');
activeSheet.setActiveCell(1,1);
activeSheet.startEdit();
window.setTimeout(function() {
spread.commandManager().execute({cmd: "commitInputNavigationDown", sheetName: "Sheet1"});
}, 1000);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• commitInputNavigationUp: Object
Represents the command used to stop cell editing and moves the active cell to the previous row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// stop cell editing and moves the active cell to the previous row with invoking command
activeSheet.setValue(1, 1, 'SpreadJS');
activeSheet.setActiveCell(1,1);
activeSheet.startEdit();
window.setTimeout(function() {
spread.commandManager().execute({cmd: "commitInputNavigationUp", sheetName: "Sheet1"});
}, 1000);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• copy: Object
Represents the command used to copy the selected item text to the Clipboard.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// copy the selected items text to the Clipboard with invoking command
spread.commandManager().execute({cmd: "copy", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• copySheet: Object
Represents the command used to copy sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The clone sheet name.
property options.targetIndex The target index.
property options.newName The new sheet name.
property options.includeBindingSource Whether to bind data source to clone sheet
example
//This example copy a sheet.
spread.commandManager().execute({cmd: "copySheet", sheetName: "Sheet1", targetIndex: targetIndex, newName: "Sheet1 (2)", includeBindingSource: true});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { includeBindingSource: boolean ; newName: string ; sheetName: string ; targetIndex: number }) => void |
• cut: Object
Represents the command used to cut the selected item text to the Clipboard.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// cut the selected items text to the Clipboard with invoking command
spread.commandManager().execute({cmd: "cut", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• deleteFloatingObjects: Object
Represents the command for deleting the floating objects.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// delete the floating objects with invoking command
spread.commandManager().execute({cmd: "deleteFloatingObjects", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }, isUndo: boolean) => boolean |
• dragCopyFloatingObjects: Object
Represents the command used to drag and copy the floating objects on the sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.floatingObjects The names array of floating objects.
property options.offsetX The horizontal offset.
property options.offsetY The vertical offset.
property isUndo true if this is an undo operation; otherwise false.
example
// copy floating objects with invoking command
var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("floatingObject1", 10, 10, 60, 64);
var div = document.createElement('div');
div.innerHTML = '<span> SpreadJS supports FloatingObject.</span>'+
'<div style="border: 1px dotted gray; width: 60%; height:70%; margin:auto;">' +
'<ul><li>First list</li></ul><ul><li>Second list</li></ul></div>';
customFloatingObject.content(div);
activeSheet.floatingObjects.add(customFloatingObject);
spread.commandManager().execute({cmd: "dragCopyFloatingObjects", sheetName: "Sheet1", floatingObjects: ["floatingObject1"], offsetX: 100, offsetY: 200});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { floatingObjects: string[] ; offsetX: number ; offsetY: number ; sheetName: string }, isUndo: boolean) => boolean |
• dragDrop: Object
Represents the command used to drag a range and drop it onto another range on the worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property commandOptions The options of the operation.
property commandOptions.sheetName The sheet name.
property commandOptions.fromRow The source row index for the drag drop.
property commandOptions.fromColumn The source column index for the drag drop.
property commandOptions.toRow The destination row index for the drag drop.
property commandOptions.toColumn The destination column index for the drag drop.
property commandOptions.rowCount The row count for the drag drop.
property commandOptions.columnCount The column count for the drag drop.
property commandOptions.copy If set to true copy; otherwise, cut if false.
property commandOptions.insert If set to true inserts the drag data in the drop row or column.
property commandOptions.option Indicates the content type to drag and drop.
property isUndo true if this is an undo operation; otherwise, false.
example
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "dragDrop", sheetName: "Sheet1", fromRow:2, fromColumn:1, toRow:12, toColumn:2, rowCount:2, columnCount:2, copy: true, insert: false, option: GC.Spread.Sheets.CopyToOptions.value});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { columnCount: number ; copy: boolean ; fromColumn: number ; fromRow: number ; insert: boolean ; option: CopyToOptions ; rowCount: number ; sheetName: string ; toColumn: number ; toRow: number }, isUndo: boolean) => boolean |
• editCell: Object
Represents the command used to apply a new value to a cell on the worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.row The row index of the cell.
property options.col The column index of the cell.
property options.newValue The new value of the cell.
property options.autoFormat Whether to format the new value automatically.
property isUndo true if this is an undo operation; otherwise, false.
example
// apply a new value to a cell with invoking command
spread.commandManager().execute({cmd: "editCell", sheetName: "Sheet1", row: 1, col: 1, newValue: "123", autoFormat: true});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { autoFormat: boolean ; col: number ; newValue: any ; row: number ; sheetName: string }, isUndo: boolean) => any |
• expandColumnOutline: Object
Represents the command to expand or collapse a column range group.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.index The outline summary index.
property options.level The outline level.
property options.collapsed Whether to make the outline collapsed or expanded.
property isUndo true if this is an undo operation; otherwise, false.
example
// collapse a column range group with invoking command
spread.commandManager().execute({cmd: "expandColumnOutline", sheetName: "Sheet1", index: 5, level: 0, collapsed: true});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { collapsed: boolean ; index: number ; level: number ; sheetName: string }, isUndo: boolean) => boolean |
• expandColumnOutlineForLevel: Object
Represents the command used to expand or collapse column range groups on the same level.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.level The outline level.
property isUndo true if this an undo operation; otherwise, false.
example
// expand or collapse a column range group with invoking command
spread.commandManager().execute({cmd: "expandColumnOutlineForLevel", sheetName: "Sheet1", level: 0});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { level: number ; sheetName: string }, isUndo: boolean) => boolean |
• expandRowOutline: Object
Represents the command to expand or collapse a row range group.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.index The outline summary index.
property options.level The outline level.
property options.collapsed Whether to make the outline collapsed or expanded.
property isUndo true if this is an undo operation; otherwise, false.
example
// expand a row range group with invoking command
spread.commandManager().execute({cmd: "expandRowOutline", sheetName: "Sheet1", index: 5, level: 0, collapsed: false});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { collapsed: boolean ; index: number ; level: number ; sheetName: string }, isUndo: boolean) => boolean |
• expandRowOutlineForLevel: Object
Represents the command used to expand or collapse row range groups on the same level.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.level The outline level.
property isUndo true if this is an undo operation; otherwise, false.
example
// expand or collapse a row range group with invoking command
spread.commandManager().execute({cmd: "expandRowOutlineForLevel", sheetName: "Sheet1", level: 0});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { level: number ; sheetName: string }, isUndo: boolean) => boolean |
• fill: Object
Represents the command used to drag and fill a range on the sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.startRange The start range.
property options.fillRange The fill range.
property options.autoFillType The auto fill type.
property options.fillDirection The fill direction.
property isUndo true if an undo operation; otherwise, false.
example
spread.options.allowUndo = true;
var srange = new GC.Spread.Sheets.Range(10, 5, 1, 1);
var frange = new GC.Spread.Sheets.Range(11, 5, 5, 1);
spread.commandManager().execute({cmd: "fill", sheetName: "Sheet1", startRange: srange, fillRange: frange, autoFillType: GC.Spread.Sheets.Fill.AutoFillType.fillSeries, fillDirection: GC.Spread.Sheets.Fill.FillDirection.down });
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { autoFillType: AutoFillType ; fillDirection: FillDirection ; fillRange: Range ; sheetName: string ; startRange: Range }, isUndo: boolean) => boolean |
• moveFloatingObjects: Object
Represents the command for moving floating objects.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.floatingObjects The names array of floating objects.
property options.offsetX The horizontal offset.
property options.offsetY The vertical offset.
property isUndo true if this is an undo operation; otherwise, false.
example
// move floating objects with invoking command
spread.commandManager().execute({cmd: "moveFloatingObjects", sheetName: "Sheet1", floatingObjects: ["floatingObject1", "floatingObject2"], offsetX: 10, offsetY: 20});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { floatingObjects: string[] ; offsetX: number ; offsetY: number ; sheetName: string }, isUndo: boolean) => boolean |
• moveSheet: Object
Represents the command used to move sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.targetIndex The target index.
example
//This example move a sheet.
spread.commandManager().execute({cmd: "moveSheet", sheetName: "Sheet1", targetIndex: targetIndex});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string ; targetIndex: number }) => boolean |
• moveToNextCell: Object
Represents the command used to move the active cell to the next cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the moveToNextCell action.
spread.focus();
spread.commandManager().setShortcutKey('moveToNextCell', GC.Spread.Commands.Key.a, false, false, false, false); // a
// move the active cell to the next cell with invoking command
spread.commandManager().execute({cmd: "moveToNextCell", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• moveToNextCellThenControl: Object
Represents the command used to select the next control if the active cell is the last visible cell; otherwise, move the active cell to the next cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the moveToNextCellThenControl action.
spread.commandManager().setShortcutKey('moveToNextCellThenControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
spread.commandManager().setShortcutKey('moveToPreviousCellThenControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• moveToPreviousCell: Object
Represents the command used to move the active cell to the previous cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the moveToPreviousCell action.
spread.commandManager().setShortcutKey('moveToPreviousCell', GC.Spread.Commands.Key.a, false, false, false, false); // a
// move the active cell to the previous cell with invoking command
spread.commandManager().execute({cmd: "moveToPreviousCell", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• moveToPreviousCellThenControl: Object
Represents the command used to select the previous control if the active cell is the first visible cell; otherwise, move the active cell to the previous cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the moveToPreviousCellThenControl action.
spread.commandManager().setShortcutKey('moveToNextCellThenControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
spread.commandManager().setShortcutKey('moveToPreviousCellThenControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationBottom: Object
Represents the command used to move the active cell to the last row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the navigationBottom action to the Tab key.
spread.commandManager().setShortcutKey('navigationDown', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
spread.commandManager().setShortcutKey('navigationBottom', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationDown: Object
Represents the command used to move the active cell to the next row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the navigationDown key.
spread.commandManager().setShortcutKey('navigationDown', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
spread.commandManager().setShortcutKey('navigationBottom', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationEnd: Object
Represents the command used to move the active cell to the last column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationEnd method.
spread.commandManager().setShortcutKey('navigationEnd', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationEnd2: Object
Represents the command used to move the active cell to the last column without regard to frozen trailing columns.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationEnd2 action.
spread.commandManager().setShortcutKey("navigationEnd2", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationFirst: Object
Represents the command used to move the active cell to the first cell in the sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationFirst action.
spread.commandManager().setShortcutKey("navigationFirst", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationHome: Object
Represents the command used to move the active cell to the first column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationHome action.
spread.commandManager().setShortcutKey("navigationHome", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationHome2: Object
Represents the command used to move the active cell to the first column without regard to frozen columns.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationHome2 action.
spread.commandManager().setShortcutKey("navigationHome2", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationLast: Object
Represents the command used to move the active cell to the last cell in the sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationLast action.
spread.commandManager().setShortcutKey("navigationLast", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationLeft: Object
Represents the command used to move the active cell to the previous column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationLeft action.
spread.commandManager().setShortcutKey("navigationLeft", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationNextSheet: Object
Represents the command used to move the active sheet to the next sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationNextSheet action.
spread.commandManager().setShortcutKey("navigationNextSheet", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationPageDown: Object
Represents the command used to move the active cell down one page of rows.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationPageDown action.
spread.commandManager().setShortcutKey("navigationPageDown", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationPageUp: Object
Represents the command used to move the active cell up one page of rows.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationPageUp action.
spread.commandManager().setShortcutKey("navigationPageUp", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationPreviousSheet: Object
Represents the command used to move the active sheet to the previous sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationPreviousSheet action.
spread.commandManager().setShortcutKey("navigationNextSheet", GC.Spread.Commands.Key.a, false, false, false, false);
spread.commandManager().setShortcutKey("navigationPreviousSheet", GC.Spread.Commands.Key.c, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }, isUndo: boolean) => any |
• navigationRight: Object
Represents the command used to move the active cell to the next column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationRight action.
spread.commandManager().setShortcutKey("navigationRight", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationTop: Object
Represents the command used to move the active cell to the first row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the navigationTop action.
spread.commandManager().setShortcutKey("navigationTop", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• navigationUp: Object
Represents the command used to move the active cell to the previous row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the navigationUp action to a.
spread.commandManager().setShortcutKey('navigationUp', GC.Spread.Commands.Key.a, false, false, false, false); // a
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• openCalculator: Object
Represents the command used to open a calculator picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a calculator with invoking command
spread.commandManager().execute({cmd: "openCalculator", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openColorPicker: Object
Represents the command used to open a color picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a color picker with invoking command
spread.commandManager().execute({cmd: "openColorPicker", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openDateTimePicker: Object
Represents the command used to open a datetime picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a dateTimePicker with invoking command
spread.commandManager().execute({cmd: "openDateTimePicker", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openList: Object
Represents the command used to open a list picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a list with invoking command
spread.commandManager().execute({cmd: "openList", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openMonthPicker: Object
Represents the command used to open a month picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a month picker with invoking command
spread.commandManager().execute({cmd: "openMonthPicker", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openMultiColumn: Object
Represents the command used to open a multi-column list picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a MultiColumn with invoking command
spread.commandManager().execute({cmd: "openMultiColumn", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openPasteSpecialDialog: Object
Represents the command used to open paste special dialog.
property context The context of the operation.
example
//This example opens the paste special dialog.
spread.commandManager().execute({cmd: "openPasteSpecialDialog", sheetName: spread.getActiveSheet().name()});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook) => void |
• openSlider: Object
Represents the command used to open a slider picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a slider with invoking command
spread.commandManager().execute({cmd: "openSlider", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openTimePicker: Object
Represents the command used to open a time picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a TimePicker with invoking command
spread.commandManager().execute({cmd: "openTimePicker", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• openUrl: Object
Represents the command used to open the url of the hyperlink cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.url The url string.
property options.target The target type, it's default is blank.
property isUndo true if this is an undo operation; otherwise, false.
example
// clear open the url of the hyperlink cell with invoking command
spread.commandManager().execute({cmd: "openUrl", sheetName: "Sheet1", url: "https://www.spreadjs.com", target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.blank});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string ; target?: HyperlinkTargetType ; url: string }, isUndo: boolean) => any |
• openWorkflowList: Object
Represents the command used to open a workflow list picker in specified cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.sheetArea The sheet area.
property options.row The rowIndex.
property options.col The columnIndex.
property isUndo true if this is an undo operation; otherwise, false.
example
// open a color picker with invoking command
spread.commandManager().execute({cmd: "openWorkflowList", sheetName: "Sheet1", row: 1, col: 2});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any |
• outlineColumn: Object
Represents the command for grouping a column outline (range group) on a sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.index The outline starting index.
property options.count The number of rows or columns to group or ungroup in the outline.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example creates a group.
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "outlineColumn", sheetName: "Sheet1", index: 3, count: 5});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean |
• outlineRow: Object
Represents the command for grouping a row outline (range group) on a sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.index The outline starting index.
property options.count The number of rows or columns to group or ungroup in the outline.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example undoes an action.
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "outlineRow", sheetName: "Sheet1", index: 3, count: 5});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean |
• paste: Object
Represents the command used to paste the selected items from the Clipboard to the current sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.shiftCells The inserted data needs to be moved in the direction.
property options.pasteOption The option of paste.
property options.pasteText The pasting text of clipboard.
property options.pasteHtml The pasting HTML of clipboard.
property options.pasteSpecialOptions
property options.pasteSpecialOptions.operationOptions The option of paste operation.
property options.pasteSpecialOptions.skipBlanks whether to skip the blank cells in the copied range without replacing the corresponding cells.
property options.pasteSpecialOptions.transpose whether to change columns of copied data to rows and vice versa.
property options.pasteSpecialOptions.pasteLink whether to paste cell references.
property options.pasteSpecialOptions.transformFormula Represents the formula for cell transform when pasting.
property options.pasteSpecialOptions.transformScope Represents the work scope for cell transform when pasting.
property isUndo true if this is an undo operation; otherwise, false.
example
// paste the selected items from the Clipboard to the current sheet with invoking command
spread.commandManager().execute({cmd: "paste", sheetName: "Sheet1", pasteText: "test"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { pasteOption: ClipboardPasteOptions ; pasteSpecialOptions: Object ; sheetName: string ; shiftCells?: InsertShiftCell }) => any |
• pasteFloatingObjects: Object
Represents the command for pasting the floating objects on the sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// paste the floating objects with invoking command
spread.commandManager().execute({cmd: "pasteFloatingObjects", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }, isUndo: boolean) => boolean |
• redo: Object
Represents the command used to perform a redo of the most recently undone edit or action.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the redo command.
spread.commandManager().execute({cmd: "redo", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• removeColumnOutline: Object
Represents the command for ungrouping a column outline (range group) on a sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.index The outline starting index.
property options.count The number of rows or columns to group or ungroup in the outline.
property isUndo true if this is an undo operation; otherwise, false.
example
// ungroup a column outline with invoking command
spread.commandManager().execute({cmd: "removeColumnOutline", sheetName: "Sheet1", index: 1, count: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean |
• removeRowOutline: Object
Represents the command for ungrouping a row outline (range group) on a sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.index The outline starting index.
property options.count The number of rows or columns to group or ungroup in the outline.
property isUndo true if this is an undo operation; otherwise, false.
example
// ungroup a row outline with invoking command
spread.commandManager().execute({cmd: "removeRowOutline", sheetName: "Sheet1", index: 1, count: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean |
• renameSheet: Object
Represents the command used to rename a worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.name The sheet's new name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example renames a sheet.
spread.commandManager().execute({cmd: "renameSheet", sheetName: "Sheet1", name: "SheetName"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { name: string ; sheetName: string }, isUndo: boolean) => any |
• reportSheetAddRecord: Object
Represents the command used to add record in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.activeRow The add record active row number.
property options.activeCol The add record active column number.
property isUndo true if this is an undo operation; otherwise, false.
example
// add record in reportSheet while in DataEntry mode with invoking command.
spread.commandManager().execute({cmd: "reportSheetAddRecord", sheetName: "Report1", activeRow: 1, activeCol: 1});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { activeCol: number ; activeRow: number ; sheetName: string }, isUndo: boolean) => boolean |
• reportSheetCollapseAll: Object
Represents the command used to collapse all collapse button in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property {GC.Spread.Sheets.Range[]} options.selections The collapse button selections.
property isUndo true if this is an undo operation; otherwise, false.
example
// collapse all collapse button while in DataEntry mode with invoking command.
spread.commandManager().execute({cmd: "reportSheetCollapseAll", sheetName: "Report1", selections: [new GC.Spread.Sheets.Range(1, 1, 1, 1)]});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { selections: Range[] ; sheetName: string }, isUndo: boolean) => boolean |
• reportSheetDeleteRecord: Object
Represents the command used to delete record in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.activeRow The deleted record active row number.
property options.activeCol The deleted record active column number.
property isUndo true if this is an undo operation; otherwise, false.
example
// delete record in reportSheet while in DataEntry mode with invoking command.
spread.commandManager().execute({cmd: "reportSheetDeleteRecord", sheetName: "Report1", activeRow: 2, activeCol: 1});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { activeCol: number ; activeRow: number ; sheetName: string }, isUndo: boolean) => boolean |
• reportSheetExpandAll: Object
Represents the command used to expand all collapse button in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property {GC.Spread.Sheets.Range[]} options.selections The collapse button selections.
property isUndo true if this is an undo operation; otherwise, false.
example
// expand all collapse button while in DataEntry mode with invoking command.
spread.commandManager().execute({cmd: "reportSheetExpandAll", sheetName: "Report1", selections: [new GC.Spread.Sheets.Range(1, 1, 1, 1)]});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { selections: Range[] ; sheetName: string }, isUndo: boolean) => boolean |
• reportSheetRegenerateReport: Object
Represents the command used to regenerate reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// regenerate reportSheet with invoking command.
spread.commandManager().execute({cmd: "reportSheetRegenerateReport", sheetName: "Report1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }, isUndo: boolean) => boolean |
• reportSheetResetCellValue: Object
Represents the command used to reset all selected cells value in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property {GC.Spread.Sheets.Range[]} options.selections The reset value selections.
property isUndo true if this is an undo operation; otherwise, false.
example
// reset all selected cells value while in DataEntry mode with invoking command.
spread.commandManager().execute({cmd: "reportSheetResetCellValue", sheetName: "Report1", selections: [new GC.Spread.Sheets.Range(1, 1, 1, 1)]});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { selections: Range[] ; sheetName: string }, isUndo: boolean) => boolean |
• reportSheetSubmit: Object
Represents the command used to submit the data entry changes in reportSheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// submit the data entry changes with invoking command.
spread.commandManager().execute({cmd: "reportSheetSubmit", sheetName: "Report1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }, isUndo: boolean) => boolean |
• resizeColumn: Object
Represents the command used to resize the column on a worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.columns The resize columns; each item is an object which has firstCol and lastCol.
property options.size The size of the column that is being resized.
property options.rowHeader Whether the column being resized is in the row header area.
property isUndo true if this is an undo operation; otherwise, false.
example
// resize the col with invoking command
spread.commandManager().execute({cmd: "resizeColumn", sheetName: "Sheet1", columns: [{firstCol: 1, lastCol: 5}], size: 200, rowHeader: false});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { columns: Object[] ; rowHeader: boolean ; sheetName: string ; size: number }, isUndo: boolean) => any |
• resizeFloatingObjects: Object
Represents the command for resizing floating objects.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.floatingObjects The names array of floating objects.
property options.offsetX The offset left.
property options.offsetY The offset top.
property options.offsetWidth The offset width.
property options.offsetHeight The offset height.
property isUndo true if this is an undo operation; otherwise, false.
example
// resize floating objects with invoking command
spread.commandManager().execute({cmd: "resizeFloatingObjects", sheetName: "Sheet1", floatingObjects: ["floatingObject1", "floatingObject2"], offsetWidth: 100, offsetHeight: 100});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { floatingObjects: string[] ; offsetHeight: number ; offsetWidth: number ; offsetX: number ; offsetY: number ; sheetName: string }, isUndo: boolean) => boolean |
• resizeRow: Object
Represents the command used to resize the row on a worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.rows The resize rows; each item is an object which has firstRow and lastRow.
property options.size The size of the row that is being resized.
property options.columnHeader Whether the row being resized is in the column header area.
property isUndo true if this is an undo operation; otherwise, false.
example
// resize the row with invoking command
spread.commandManager().execute({cmd: "resizeRow", sheetName: "Sheet1", rows: [{firstRow: 1, lastRow: 5}], size: 100, rowHeader: false});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { columnHeader: boolean ; rows: Object[] ; sheetName: string ; size: number }, isUndo: boolean) => any |
• selectNextControl: Object
Represents the command used to select the next control.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the selectNextControl action to the Tab key.
spread.commandManager().setShortcutKey('selectNextControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
spread.commandManager().setShortcutKey('selectPreviousControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectPreviousControl: Object
Represents the command used to select the previous control.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example maps the selectPreviousControl action to the Shift + Tab key combination.
spread.commandManager().setShortcutKey('selectNextControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key
spread.commandManager().setShortcutKey('selectPreviousControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionBottom: Object
Represents the command used to extend the selection to the last row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionBottom action.
spread.commandManager().setShortcutKey('selectionBottom', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionDown: Object
Represents the command used to extend the selection down one row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionDown action.
spread.commandManager().setShortcutKey('selectionDown', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionEnd: Object
Represents the command used to extend the selection to the last column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionEnd action.
spread.focus();
spread.commandManager().setShortcutKey('selectionEnd', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionFirst: Object
Represents the command used to extend the selection to the first cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionFirst action.
spread.focus();
spread.commandManager().setShortcutKey('selectionFirst', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionHome: Object
Represents the command used to extend the selection to the first column.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionHome action.
spread.focus();
spread.commandManager().setShortcutKey('selectionHome', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionLast: Object
Represents the command used to extend the selection to the last cell.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionLast action.
spread.focus();
spread.commandManager().setShortcutKey('selectionLast', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionLeft: Object
Represents the command used to extend the selection one column to the left.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionLeft action.
spread.commandManager().setShortcutKey('selectionLeft', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }, isUndo: boolean) => any |
• selectionPageDown: Object
Represents the command used to extend the selection down to include one page of rows.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionPageDown action.
spread.commandManager().setShortcutKey('selectionPageDown', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionPageUp: Object
Represents the command used to extend the selection up to include one page of rows.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionPageUp action.
spread.commandManager().setShortcutKey('selectionPageUp', GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionRight: Object
Represents the command used to extend the selection one column to the right.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionRight action.
spread.commandManager().setShortcutKey("selectionRight", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionTop: Object
Represents the command used to extend the selection to the first row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionTop action.
spread.commandManager().setShortcutKey("selectionTop", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• selectionUp: Object
Represents the command used to extend the selection up one row.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the selectionUp action.
spread.commandManager().setShortcutKey("selectionUp", GC.Spread.Commands.Key.a, false, false, false, false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• splitResizeColumn: Object
Represents the command used to split resize the column on a worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.columns The resize columns; each item is an object which has firstCol and lastCol.
property options.size The size of the column that is being resized.
property options.rowHeader Whether the column being resized is in the row header area.
property isUndo true if this is an undo operation; otherwise, false.
example
// split resize the column with invoking command
spread.commandManager().execute({cmd: "splitResizeColumn", sheetName: "Sheet1", columns: [{firstCol: 1, lastCol: 2}]}, size: 100, rowHeader: false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { columns: Object[] ; rowHeader: boolean ; sheetName: string ; size: number }, isUndo: boolean) => any |
• splitResizeRow: Object
Represents the command used to split resize the row on a worksheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.rows The resize rows; each item is an object which has firstRow and lastRow.
property options.size The size of the row that is being resized.
property options.columnHeader Whether the row being resized is in the column header area.
property isUndo true if this is an undo operation; otherwise, false.
example
// split resize the row with invoking command
spread.commandManager().execute({cmd: "splitResizeRow", sheetName: "Sheet1", rows: [{firstRow: 1, lastRow: 2}]}, size: 100, columnHeader: false);
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { columnHeader: boolean ; rows: Object[] ; sheetName: string ; size: number }, isUndo: boolean) => any |
• startEdit: Object
Represents the command used to start editing the active cell with the edit mode.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
// start editing a cell with invoking command
spread.commandManager().execute({cmd: "startEdit", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• tableDeleteColumns: Object
Represents the command used to delete columns for table.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.tableName The table name.
property options.col The index of the starting column to delete, the col index is based on table index.
property options.count The number of columns to delete.
property isUndo true if this is an undo operation; otherwise, false.
example
// delete columns for table with invoking command
spread.commandManager().execute({cmd: "tableDeleteColumns", sheetName: "Sheet1", tableName: "table1", col: 1, count: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; count: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean |
• tableDeleteRows: Object
Represents the command used to delete rows for table.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.tableName The table name.
property options.row The index of the starting row to delete, the row index is based on table index.
property options.count The number of rows to delete.
property isUndo true if this is an undo operation; otherwise, false.
example
// delete rows for table with invoking command
spread.commandManager().execute({cmd: "tableDeleteRows", sheetName: "Sheet1", tableName: "table1", row: 1, count: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { count: number ; row: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean |
• tableInsertColumns: Object
Represents the command used to insert columns for table.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.tableName The table name.
property options.col The index of the starting column to insert, the col index is based on table index.
property options.count The number of columns to insert.
property isUndo true if this is an undo operation; otherwise, false.
example
// insert columns for table with invoking command
spread.commandManager().execute({cmd: "tableInsertColumns", sheetName: "Sheet1", tableName: "table1", col: 1, count: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { col: number ; count: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean |
• tableInsertRows: Object
Represents the command used to insert rows for table.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.tableName The table name.
property options.row The index of the starting row to insert, the row index is based on table index.
property options.count The number of rows to insert.
property isUndo true if this is an undo operation; otherwise, false.
example
// insert rows for table with invoking command
spread.commandManager().execute({cmd: "tableInsertRows", sheetName: "Sheet1", tableName: "table1", row: 1, count: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { count: number ; row: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean |
• tableResize: Object
Represents the command used to resize table.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.tableName The table name.
property options.resizeToRange The resized table range.
property isUndo true if this is an undo operation; otherwise, false.
example
// resize table with invoking command
spread.commandManager().execute({cmd: "tableResize", sheetName: "Sheet1", tableName: "table1", resizeToRange: new GC.Spread.Sheets.Range(1, 1, 5, 3)});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { resizeToRange: Range ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean |
• tableSubmitChanges: Object
Represents the command used to submit changes of the tables which bind data manager tables.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property [options.sheetName] The sheet name, from active sheet by default.
property {string[]} [options.tableNames] The table names, from active table by default.
property isUndo true if this is an undo operation; otherwise, false.
example
// submit changes of the tables which bind the data manager tables with invoking command
spread.commandManager().execute({cmd: "tableSubmitChanges", sheetName: "Sheet1", tableNames: ["table1"]});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName?: string ; tableNames?: string[] }, isUndo: boolean) => boolean |
• undo: Object
Represents the command used to perform an undo of the most recent edit or action.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property isUndo true if this is an undo operation; otherwise, false.
example
//This example uses the undo command.
spread.commandManager().execute({cmd: "undo", sheetName: "Sheet1"});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string }) => any |
• zoom: Object
Represents the command used to zoom the sheet.
property canUndo - indicates whether the command supports undo and redo operations.
property execute - performs an execute or undo operation.
The arguments of the execute method are as follows.
property context The context of the operation.
property options The options of the operation.
property options.sheetName The sheet name.
property options.zoomFactor The zoom factor.
property isUndo true if this is an undo operation; otherwise, false.
example
// zoom the sheet with invoking command
spread.commandManager().execute({cmd: "zoom", sheetName: "Sheet1", zoomFactor: 3});
| Name | Type |
|---|---|
canUndo |
boolean |
execute |
(context: Workbook, options: { sheetName: string ; zoomFactor: number }, isUndo: boolean) => any |
▸ endTransaction(context, options): void
Ends a transaction. During the transaction, the changes of the data model will be saved.
property context The context of the operation.
property options The options of the operation.
property {string|string[]} [options.sheetName] The sheet name. If the current transaction need change multiple worksheets, the sheetName could be a string Array.
example
//For example, the following code registers the changeBackColor command and then executes the command.
var command = {
canUndo: true,
execute: function (context, options, isUndo) {
var Commands = GC.Spread.Sheets.Commands;
options.cmd = "changeBackColor";
if (isUndo) {
Commands.undoTransaction(context, options);
return true;
} else {
Commands.startTransaction(context, options);
var sheet = context.getSheetFromName(options.sheetName);
var cell = sheet.getCell(options.row, options.col);
cell.backColor(options.backColor);
Commands.endTransaction(context, options);
return true;
}
}
};
var spread = GC.Spread.Sheets.findControl(document.getElementById("ss"));
var commandManager = spread.commandManager();
commandManager.register("changeBackColor", command);
commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"});
| Name | Type |
|---|---|
context |
Workbook |
options |
any |
void
▸ startTransaction(context, options): void
Starts a transaction. During the transaction, the changes of the data model will be saved.
property context The context of the operation.
property options The options of the operation.
property {string|string[]} [options.sheetName] The sheet name. If the current transaction need change multiple worksheets, the sheetName could be a string Array.
example
//For example, the following code registers the changeBackColor command and then executes the command.
var command = {
canUndo: true,
execute: function (context, options, isUndo) {
var Commands = GC.Spread.Sheets.Commands;
options.cmd = "changeBackColor";
if (isUndo) {
Commands.undoTransaction(context, options);
return true;
} else {
Commands.startTransaction(context, options);
var sheet = context.getSheetFromName(options.sheetName);
var cell = sheet.getCell(options.row, options.col);
cell.backColor(options.backColor);
Commands.endTransaction(context, options);
return true;
}
}
};
var spread = GC.Spread.Sheets.findControl(document.getElementById("ss"));
var commandManager = spread.commandManager();
commandManager.register("changeBackColor", command);
commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"});
| Name | Type |
|---|---|
context |
Workbook |
options |
any |
void
▸ undoTransaction(context, options): void
Undo the changes made in a transaction.
property context The context of the operation.
property options The options of the operation.
property {string|string[]} [options.sheetName] The sheet name. If the current transaction need change multiple worksheets, the sheetName could be a string Array.
example
//For example, the following code registers the changeBackColor command and then executes the command.
var command = {
canUndo: true,
execute: function (context, options, isUndo) {
var Commands = GC.Spread.Sheets.Commands;
options.cmd = "changeBackColor";
if (isUndo) {
Commands.undoTransaction(context, options);
return true;
} else {
Commands.startTransaction(context, options);
var sheet = context.getSheetFromName(options.sheetName);
var cell = sheet.getCell(options.row, options.col);
cell.backColor(options.backColor);
Commands.endTransaction(context, options);
return true;
}
}
};
var spread = GC.Spread.Sheets.findControl(document.getElementById("ss"));
var commandManager = spread.commandManager();
commandManager.register("changeBackColor", command);
commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"});
| Name | Type |
|---|---|
context |
Workbook |
options |
any |
void