Call event rangechange in custom event by commandManager

Posted by: cangod05 on 4 October 2022, 6:36 pm EST

  • Posted 4 October 2022, 6:36 pm EST

    Hi SpreadJS Admin,

    I customized event delete in code but i had an issue that when delete a range including a group merge cell I set value all of row and col by blank excepting cell readonly but it trigger multiple time cell changed (build in event spreadjs) but now i want to it only call once in range changed instead cellchange multiple time.

    Do you have a function to call rangeChanged or something like that.

    Tks sir.

  • Posted 5 October 2022, 10:08 pm EST

    Hi,

    If you are changing the cell value by code you may create your own custom event bus and publish to that event only. This would be recommended approach to handle this scenario. further you can suspend the spreadJS event by using the following code snippet.

    
    sheet.suspendEvent()
    sheet.set(0,0,"value");
    myeventBus.publish("CellChangedByCode",{sheet,row:0,col:0});
    sheet.resumeEvent()

    suspendEvent: https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#suspendEvent

    resumeEvent:https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#resumeevent

    regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels