Get backColor event in .bind function

Posted by: ricardo.aleixo on 24 April 2023, 11:53 pm EST

    • Post Options:
    • Link

    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);
        }
    });

    Sample: https://jscodemine.grapecity.com/share/D47chKUIOE6jE3lW8-SwZw/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    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

    Hi, it’s works.

    I’m using TypeScript, and when i define a type to the ‘designer’ as type

    GC.Spread.Sheets.Workbook
    i can’t find the method
    addListener

    So i created a const when i define the variable as type any and that works.

    but no problem.

    thanks!

  • 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

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels