Skip to main content

beforeSelectionSet

Description

Fires before cells are selected

Usage

beforeSelectionSet: (cell: string) => void | boolean;

Parameters

The callback of the event takes the following parameters:

  • cell - (required) the id(s) of a cell(s)

Returns

Return true to select cells, false to prevent selection of cells

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {
// config parameters
});
// subscribe on the "beforeSelectionSet" event
spreadsheet.events.on("beforeSelectionSet", function(cell){
console.log("Cells "+spreadsheet.selection.getSelectedCell()+" will be selected");
console.log(cell);
return true;
});

Related articles: Event handling