Posted 24 April 2023, 11:53 pm EST
I can’t get the backColor event at bind function in version 16.0.3 using
GC.Spread.Sheets.Events.CellChanged
.
But in version 15.1.4 it’s work.
This event changed?
Forums Home / Spread / SpreadJS
Posted by: ricardo.aleixo on 24 April 2023, 11:53 pm EST
Posted 24 April 2023, 11:53 pm EST
I can’t get the backColor event at bind function in version 16.0.3 using
GC.Spread.Sheets.Events.CellChanged
.
But in version 15.1.4 it’s work.
This event changed?
Posted 26 April 2023, 2:39 pm EST
Hello,
As I can understand, it seems you are setting the background color from designer.
In SpreadJS v15.1.4, it triggers CellChanged event when changing background from designer ribbon but in SpreadJS v16.0.3 it does not trigger CellChanged event. Please note that this is a breaking change to better the performance of SpreadJS. This change was made in SpreadJS v15.2.2.
You can add a listener to command manager of spread. When the background color is set through designer ribbon, the handler function is called. In the handler function, you can find the applied background color to cell.
Please refer to the code snippet and attached sample.
spread.commandManager().addListener('appListener', (args) => {
if (args.command && args.command.cmd === "Designer.setBackColor") {
console.log(args);
console.log(args.command.value);
}
});
Please let us know if you still face any issues.
Doc references:
spread.commandManager(): https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Workbook#commandmanager
Regards,
Ankit
Posted 26 April 2023, 11:03 pm EST - Updated 26 April 2023, 11:09 pm EST
Posted 27 April 2023, 2:51 pm EST
Hi,
We are happy that your issue has been resolved. Yes, you could define the workbook’s type as “any” and use in your typescript application.
Regards,
Ankit