| sidebar_label | beforeAction |
|---|---|
| title | beforeAction event |
| description | You can learn about the beforeAction event in the documentation of the DHTMLX JavaScript Spreadsheet library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet. |
@short: Fires before an action is executed
beforeAction: (action: string, config: object) => void | boolean;The callback of the event takes the following parameters:
action- (required) the name of the action. Check the full list of available actions hereconfig- (required) an object with parameters of the action
Return false to prevent an action from being executed; otherwise, return true
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: