Catching the events of Conditional Format and Cell States

Posted by: devadmin on 15 November 2021, 11:15 pm EST

  • Posted 15 November 2021, 11:15 pm EST

    Hi!
    Is it possible to be notified/catch an event when a Conditional Format or Cell State is applied to a cell?
    None of these are triggered in these cases:
    https://www.grapecity.com/spreadjs/docs/v14/online/SpreadJS~GC.Spread.Sheets.Events.html
  • Replied 21 November 2021, 2:20 pm EST

    Hi,

    Could you let me know how exactly the formatting is getting added to the cell are you using designer? or you are changing the state and formatting by code.

    1. if you are changing the format and state by code then you could create a custom event bus and publish the event whenever it is needed.

    2. If you are using the designer then you may use the following code snippet to listen al the designer actions event


    ss.commandManager().addListener('appListener', function (cmd) {
    if(cmd.command.cmd ==="Designer.addRule" || cmd.command.cmd ==="Designer.addCellState")
    console.log(cmd);
    });


    Regards
    Avinash
  • Marked as Answer

    Replied 17 November 2021, 2:14 am EST

    Thank you for the code snippet, that's what I was looking for!
Need extra support?

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

Learn More

Forum Channels