Skip to main content

beforeStyleChange

fires before the style of cells is changed

beforeStyleChange: (cell: string, style: string | string[] | IStylesList | IStylesList[]) => void | boolean;

Parameters:

  • cell: string - the id(s) of a cell(s)
  • style: string, object, array - styles set for a cell/cells

Returns:

True to change the style of a cell, false to prevent changing of style.

Example

spreadsheet.events.on("beforeStyleChange", function(cell,style){
console.log("Style of cell "+spreadsheet.selection.getSelectedCell()+" will change");
return true;
});

The event is blockable, returning false will prevent changing of style.