Skip to main content

beforeAction

Description

Fires before an action is executed

Usage

beforeAction: (action: string, config: object) => void | boolean;

Parameters

The callback of the event takes the following parameters:

  • action - (required) the name of the action. Check the full list of available actions here
  • config - (required) an object with parameters of the action

Returns

Return false to prevent an action from being executed; otherwise, return true

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
// config parameters
});
spreadsheet.parse(dataset);

spreadsheet.events.on("beforeAction", (actionName, config) => {
if (actionName === "sortCells") {
console.log(actionName, config);
return false;
}
});

Changelog: Added in v4.3

Related articles: