| sidebar_label | beforeEditStart |
|---|---|
| title | beforeEditStart event |
| description | Control which cells can be edited in DHTMLX Spreadsheet with the beforeEditStart event, and return false to prevent the editor from opening. |
@short: Fires before editing of a cell starts
beforeEditStart: (cell: string, value: string) => void | boolean;The callback of the event takes the following parameters:
cell- (required) the id of a cellvalue- (required) the value of a cell
Return true to edit a cell, false to prevent editing
const spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {});
spreadsheet.parse(data);
// subscribe on the "beforeEditStart" event
spreadsheet.events.on("beforeEditStart", function(cell, value){
console.log("Editing is about to start");
console.log(cell, value);
return true;
});Related article: Event handling