[]
        
(Showing Draft Content)

GC.Spread.Sheets.Commands

Namespace: Commands

Spread.Sheets.Commands

Table of contents

Variables

Functions

Variables

autoFitColumn

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.columns The resize columns; each item is an object which has a col. options.rowHeader Whether the resized columns are in the row header area. options.autoFitType Whether the auto-fit action includes the header text. 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});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { autoFitType: AutoFitType ; columns: Object[] ; rowHeader: boolean ; sheetName: string }, isUndo: boolean) => any

autoFitRow

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.rows The resize rows; each item is an object which has a row. options.columnHeader Whether the resized rows are in the column header area. options.autoFitType Whether the auto-fit action includes the header text. 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});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { autoFitType: AutoFitType ; columnHeader: boolean ; rows: Object[] ; sheetName: string }, isUndo: boolean) => any

cancelInput

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

changeFormulaReference

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

clear

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

clearAndEditing

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

clearValues

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.ranges The clear cell value ranges whose item type is GC.Spread.Sheets.Range. 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)]});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { ranges: Range[] ; sheetName: string }, isUndo: boolean) => any

clipboardPaste

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.fromSheet The source sheet. options.fromRanges The source range array which item type is GC.Spread.Sheets.Range. options.pastedRanges The target range array which item type is GC.Spread.Sheets.Range. options.isCutting Whether the operation is cutting or copying. options.clipboardText The text on the clipboard. options.pasteOption The Clipboard pasting option that indicates which content to paste. 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)];
$("#button1").click(function () {
    //Cut Paste Action
    spread.commandManager().execute({cmd: "clipboardPaste", sheetName: "Sheet1", fromSheet: activeSheet, fromRanges: fromRange, pastedRanges: toRanges, isCutting: true, clipboardText: "", pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all});
});
$("#button2").click(function () {
    spread.commandManager().execute({cmd: "clipboardPaste", sheetName: "Sheet1", fromSheet: activeSheet, fromRanges: fromRange, pastedRanges: toRanges, isCutting: false, clipboardText: "", pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all});
});
//Add button controls to page
<input type="button" id="button1" value="button1"/>
<input type="button" id="button2" value="button2"/>

Type declaration

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

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

commitInputNavigationDown

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

commitInputNavigationUp

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

copy

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

copySheet

• copySheet: Object

Represents the command used to copy sheet.

param The context of the operation.

param The options of the operation. The arguments of the execute method are as follows. context The context of the operation. options The options of the operation. options.sheetName The clone sheet name. options.targetIndex The target index. options.newName The new sheet name. 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});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { includeBindingSource: boolean ; newName: string ; sheetName: string ; targetIndex: number }) => void

cut

• 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. context The context of the operation. options The options of the operation.

  • options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

deleteFloatingObjects

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }, isUndo: boolean) => boolean

dragCopyFloatingObjects

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.floatingObjects The names array of floating objects. options.offsetX The horizontal offset. options.offsetY The vertical offset. isUndo true if this is an undo operation; otherwise false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { floatingObjects: string[] ; offsetX: number ; offsetY: number ; sheetName: string }, isUndo: boolean) => boolean

dragDrop

• 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. context The context of the operation. commandOptions The options of the operation. commandOptions.sheetName The sheet name. commandOptions.fromRow The source row index for the drag drop. commandOptions.fromColumn The source column index for the drag drop. commandOptions.toRow The destination row index for the drag drop. commandOptions.toColumn The destination column index for the drag drop. commandOptions.rowCount The row count for the drag drop. commandOptions.columnCount The column count for the drag drop. commandOptions.copy If set to true copy; otherwise, cut if false. commandOptions.insert If set to true inserts the drag data in the drop row or column. commandOptions.option Indicates the content type to drag and drop. 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});

Type declaration

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

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.row The row index of the cell. options.col The column index of the cell. options.newValue The new value of the cell. options.autoFormat Whether to format the new value automatically. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { autoFormat: boolean ; col: number ; newValue: any ; row: number ; sheetName: string }, isUndo: boolean) => any

expandColumnOutline

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.index The outline summary index. options.level The outline level. options.collapsed Whether to make the outline collapsed or expanded. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { collapsed: boolean ; index: number ; level: number ; sheetName: string }, isUndo: boolean) => boolean

expandColumnOutlineForLevel

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.level The outline level. isUndo true if this an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { level: number ; sheetName: string }, isUndo: boolean) => boolean

expandRowOutline

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.index The outline summary index. options.level The outline level. options.collapsed Whether to make the outline collapsed or expanded. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { collapsed: boolean ; index: number ; level: number ; sheetName: string }, isUndo: boolean) => boolean

expandRowOutlineForLevel

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.level The outline level. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { level: number ; sheetName: string }, isUndo: boolean) => boolean

fill

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.startRange The start range. options.fillRange The fill range. options.autoFillType The auto fill type. options.fillDirection The fill direction. 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 });

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { autoFillType: AutoFillType ; fillDirection: FillDirection ; fillRange: Range ; sheetName: string ; startRange: Range }, isUndo: boolean) => boolean

moveFloatingObjects

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.floatingObjects The names array of floating objects. options.offsetX The horizontal offset. options.offsetY The vertical offset. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { floatingObjects: string[] ; offsetX: number ; offsetY: number ; sheetName: string }, isUndo: boolean) => boolean

moveSheet

• moveSheet: Object

Represents the command used to move sheet.

param The context of the operation.

param The options of the operation. The arguments of the execute method are as follows. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.targetIndex The target index.

example

//This example move a sheet.
spread.commandManager().execute({cmd: "moveSheet", sheetName: "Sheet1", targetIndex: targetIndex});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string ; targetIndex: number }) => boolean

moveToNextCell

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

moveToNextCellThenControl

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

moveToPreviousCell

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

moveToPreviousCellThenControl

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation.

  • options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

openCalculator

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openColorPicker

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openDateTimePicker

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openList

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openMonthPicker

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openMultiColumn

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openPasteSpecialDialog

• openPasteSpecialDialog: Object

Represents the command used to open paste special dialog.

param The context of the operation.

example

//This example copy a sheet.
spread.commandManager().execute({cmd: "openPasteSpecialDialog"});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook) => void

openSlider

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openTimePicker

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

openUrl

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.url The url string. options.target The target type, it's default is blank. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string ; target?: HyperlinkTargetType ; url: string }, isUndo: boolean) => any

openWorkflowList

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.sheetArea The sheet area. options.row The rowIndex. options.col The columnIndex. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; row: number ; sheetArea: SheetArea ; sheetName: string }, isUndo: boolean) => any

outlineColumn

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.index The outline starting index. options.count The number of rows or columns to group or ungroup in the outline. 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});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean

outlineRow

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.index The outline starting index. options.count The number of rows or columns to group or ungroup in the outline. 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});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean

paste

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.shiftCells The inserted data needs to be moved in the direction. options.pasteOption The option of paste. options.pasteSpecialOptions options.pasteSpecialOptions.operationOptions The option of paste operation. options.pasteSpecialOptions.skipBlanks whether to skip the blank cells in the copied range without replacing the corresponding cells. options.pasteSpecialOptions.transpose whether to change columns of copied data to rows and vice versa. options.pasteSpecialOptions.pasteLink whether to paste cell references. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { pasteOption: ClipboardPasteOptions ; pasteSpecialOptions: Object ; sheetName: string ; shiftCells?: InsertShiftCell }) => any

pasteFloatingObjects

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }, isUndo: boolean) => boolean

redo

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

example

//This example uses the undo or redo action.
$("#button1").click(function () {
   if(spread.undoManager().canUndo()){
       spread.undoManager().undo();
   }
});
$("#button2").click(function () {
    if(spread.undoManager().canRedo()){
        spread.undoManager().redo();
    }
});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

removeColumnOutline

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.index The outline starting index. options.count The number of rows or columns to group or ungroup in the outline. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean

removeRowOutline

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.index The outline starting index. options.count The number of rows or columns to group or ungroup in the outline. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { count: number ; index: number ; sheetName: string }, isUndo: boolean) => boolean

renameSheet

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.name The sheet's new name. 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"});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { name: string ; sheetName: string }, isUndo: boolean) => any

resizeColumn

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.columns The resize columns; each item is an object which has firstCol and lastCol. options.size The size of the column that is being resized. options.rowHeader Whether the column being resized is in the row header area. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { columns: Object[] ; rowHeader: boolean ; sheetName: string ; size: number }, isUndo: boolean) => any

resizeFloatingObjects

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.floatingObjects The names array of floating objects. options.offsetX The offset left. options.offsetY The offset top. options.offsetWidth The offset width. options.offsetHeight The offset height. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { floatingObjects: string[] ; offsetHeight: number ; offsetWidth: number ; offsetX: number ; offsetY: number ; sheetName: string }, isUndo: boolean) => boolean

resizeRow

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.rows The resize rows; each item is an object which has firstRow and lastRow. options.size The size of the row that is being resized. options.columnHeader Whether the row being resized is in the column header area. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { columnHeader: boolean ; rows: Object[] ; sheetName: string ; size: number }, isUndo: boolean) => any

selectNextControl

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectPreviousControl

• 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. context The context of the operation. options The options of the operation.

  • options.sheetName The sheet name. 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

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionBottom

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionDown

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionEnd

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionFirst

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionHome

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionLast

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionLeft

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }, isUndo: boolean) => any

selectionPageDown

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionPageUp

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionRight

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionTop

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

selectionUp

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. 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);

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

splitResizeColumn

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.columns The resize columns; each item is an object which has firstCol and lastCol. options.size The size of the column that is being resized. options.rowHeader Whether the column being resized is in the row header area. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { columns: Object[] ; rowHeader: boolean ; sheetName: string ; size: number }, isUndo: boolean) => any

splitResizeRow

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.rows The resize rows; each item is an object which has firstRow and lastRow. options.size The size of the row that is being resized. options.columnHeader Whether the row being resized is in the column header area. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { columnHeader: boolean ; rows: Object[] ; sheetName: string ; size: number }, isUndo: boolean) => any

tableDeleteColumns

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.tableName The table name. options.col The index of the starting column to delete, the col index is based on table index. options.count The number of columns to delete. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; count: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean

tableDeleteRows

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.tableName The table name. options.row The index of the starting row to delete, the row index is based on table index. options.count The number of rows to delete. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { count: number ; row: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean

tableInsertColumns

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.tableName The table name. options.col The index of the starting column to insert, the col index is based on table index. options.count The number of columns to insert. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { col: number ; count: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean

tableInsertRows

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.tableName The table name. options.row The index of the starting row to insert, the row index is based on table index. options.count The number of rows to insert. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { count: number ; row: number ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean

tableResize

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.tableName The table name. options.resizeToRange The resized table range. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { resizeToRange: Range ; sheetName: string ; tableName: string }, isUndo: boolean) => boolean

undo

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. isUndo true if this is an undo operation; otherwise, false.

example

//This example uses the undo or redo action.
$("#button1").click(function () {
     if(spread.undoManager().canUndo()){
         spread.undoManager().undo();
     }
 });
$("#button2").click(function() {
     if(spread.undoManager().canRedo()){
         spread.undoManager().redo();
     }
});

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string }) => any

zoom

• 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. context The context of the operation. options The options of the operation. options.sheetName The sheet name. options.zoomFactor The zoom factor. isUndo true if this is an undo operation; otherwise, false.

Type declaration

Name Type
canUndo boolean
execute (context: Workbook, options: { sheetName: string ; zoomFactor: number }, isUndo: boolean) => any

Functions

endTransaction

▸ endTransaction(context, options): void

Ends a transaction. During the transaction, the changes of the data model will be saved.

Parameters

Name Type Description
context Workbook The context of the operation.
options any The options of the operation.

Returns

void


startTransaction

▸ startTransaction(context, options): void

Starts a transaction. During the transaction, the changes of the data model will be saved.

Parameters

Name Type Description
context Workbook The context of the operation.
options any The options of the operation.

Returns

void


undoTransaction

▸ undoTransaction(context, options): void

Undo the changes made in a transaction.

Parameters

Name Type Description
context Workbook The context of the operation.
options any The options of the operation.

Returns

void