Skip to main content

afterStyleChange

caution

The afterStyleChange event has been deprecated in v4.3. The event will continue work, but you'd better apply a new approach:

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

For more details about the new concept, see Spreadsheet actions.

Description

Fires after the style of a cell is changed

Usage

afterStyleChange: (cell: string, style: object | array) => void;

Parameters

The callback of the event takes the following parameters:

  • cell - (required) the id of a cell
  • style - (required) styles set for a cell

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {});
spreadsheet.parse(data);

// subscribe on the "afterStyleChange" event
spreadsheet.events.on("afterStyleChange", function(cell, style){
console.log("Style of cell "+spreadsheet.selection.getSelectedCell()+" is changed");
console.log(cell, style);
});

Related articles: Event handling