Skip to main content

StartAction

Specifies the start action for long operations.

note

GroupActions are available only for ONLYOFFICE Docs Enterprise and ONLYOFFICE Docs Developer.

Syntax​

expression.StartAction(type, description);

expression - A variable that represents an Api class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
typeRequired"Information" | "Block" | "GroupActions"The action type: "Information" - a non-blocking informational action, "Block" - a blocking interaction action, "GroupActions" - groups multiple editor operations into a single undoable step.
descriptionOptionalstring | ObjectFor "Information" and "Block" types: a string description displayed during the action. For "GroupActions" type: an optional object with the following properties:
description.lockScrollOptionalbooleanIf true, the editor scroll position will be locked during the group operation.
description.keepSelectionOptionalbooleanIf true, the cursor position and selection will be preserved after the group operation ends.

Returns​

This method doesn't return any data.

Example​

window.Asc.plugin.executeMethod ("StartAction", ["Block", "Save to local storage..."], function () {
setPasswordByFile ("sha256", "123456");

setTimeout (function () {
window.Asc.plugin.executeMethod ("EndAction", ["Block", "Save to localstorage..."]);
}, 200);
});