Workbook methods

The Workbook class has the following methods.

startup
Begins the startup sequence for this object. Call this function after the object is added to the document. The onLoad method is run after the startup sequence completes.
Applies to both CubeViewer and Workbook objects.
Syntax: startup()
Example:
document.body.appendChild(loadedWebsheet.domNode);
loadedWebsheet.startup();
See the Dojo documentation for dijit._WidgetBase#startup.
commitActiveSandbox

Commits changed data in the active sandbox to the base sandbox.

Returns dojo.promise.Promise. A promise that is resolved when the sandbox commit attempt completes. Any callbacks that are registered with the promise are passed a boolean with a value of true if the sandbox commit was successful or a value of false if the commit was not successful.

copy
Copies the selected cells to the clipboard if a selection exists.
destroy
Destroys this object and prepares it for garbage collection.

See Dojo documentation for dijit._WidgetBase#destroy.

logout
Destroys the TM1® Web session that is associated with this object's sessionToken.
Returns dojo.promise.Promise as a promise that is resolved when the logout completes.
onActionButtonExecution
Called when an action button is executed.
Syntax: onActionButtonExecution: function(executionResults){}
Parameters: executionResults object that uses the following format.
calculation
Type: String
What type of calculation occurred on the current Workbook before action button execution occurred.
Value will be one of "None", "Recalculate", "Rebuild".
navigation
Type: Object
This property exists only if workbook or sheet navigation occurred as part of the action button execution.
calculation
Type: String
What type of calculation occurred on the target Workbook after the action button navigation occurred.
Value will be one of "None", "Recalculate", "Rebuild".
objectId
Type: String
The objectId of the workbook that has been navigated to. If an action on a worksheet within the same workbook occurred, the objectId will match the current workbook.
path
Type: String
The path to the workbook that was navigated to.
name
Type: String
The name of the target workbook.
sheetIndex
Type: Integer
The zero-based index of the worksheet that was navigated to.
replace
Type: Boolean
Whether the action button was configured to replace the existing workbook.
tiProcess
Type: Object
This property exists only if a TI process was executed as part of the action button's execution.
calculation
Type: String
What type of calculation occurred on the current workbook after the TI process was executed.
Value will be one of "None, "Recalculate", "Rebuild".
name
Type: String
The name of the TI process that was executed.
executionSucceeded
Type: Boolean
Whether or not the TI process execution was successful.
onLoad
Runs when the object is finished loading.
onTitleDimensionElementChange
Executed when a title dimension element is changed. Can be overridden during object construction or attached to using dojo/aspect module.
Syntax: onTitleDimensionElementChange: function(elementInfo){}
Parameters: elementInfo object that uses the following format.
sheetIndex
Type: Integer
The zero-based index of the sheet that contains the SUBNM cell that was changed.
rowIndex
Type: Integer
The zero-based index of the row that contains the SUBNM cell that was changed.
columnIndex
Type: Integer
The zero-based index of the column that contains the SUBNM cell that was changed.
dimension
Type: String
The name of the dimension.
element
Type: String
The name of the element.
elementIndex
Type: Integer
The one-based index of the dimension element.
paste
Pastes the contents of the clipboard into the current selected area if a selection exists.
rebuildActiveForms
Rebuilds the active forms in the workbook.
Returns dojo.promise.Promise as a promise that is resolved when active forms are rebuilt.
redo
Performs a redo action.
Returns dojo.promise.Promise as a promise that is resolved when the redo action completes.
replace
Accepts an objectId and replaces the existing workbook with the one represented from the given objectId (unless it is the same as the existing websheet, in which case nothing no action is taken).
Replace assumes that the workbook that is replacing the existing one uses the same TM1 Web session as the previous workbook.
undo
Performs an undo action.
Returns dojo.promise.Promise as a promise that is resolved when the undo action completes.