Skip to main content

afterFormatChange

caution

The afterFormatChange 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 === "setCellFormat") {
console.log(actionName, config);
}
});

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

Description

Fires after the format of a cell is changed

Usage

afterFormatChange: (cell: string, format: string) => void;

Parameters

The callback of the event takes the following parameters:

  • cell - (required) the id of a cell
  • format - (required) a new format applied for a cell

Example

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

// subscribe on the "afterFormatChange" event
spreadsheet.events.on("afterFormatChange", function(cell, format){
console.log("Format of cell "+spreadsheet.selection.getSelectedCell()+" has changed");
console.log(cell, format);
});

Related articles:

Related sample: Spreadsheet. Events