Skip to main content

beforeSheetChange

Description

Fires before changing the currently active sheet

Usage

beforeSheetChange: (sheet: object) => void | boolean;

Parameters

The callback of the event takes the following parameters:

  • sheet - (required) an object with the name and id of the currently active sheet

Returns

Return true to change the active sheet, false to prevent the active sheet from being changed

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
// config parameters
});
// subscribe on the "beforeSheetChange" event
spreadsheet.events.on("beforeSheetChange", function(sheet) {
console.log("The active sheet will be changed");
console.log(sheet);
return true;
});

Changelog: Added in v4.1

Related articles: Event handling