floatingObjectChanged fires multiple times

Posted by: nbrassington on 4 December 2020, 11:05 pm EST

  • Posted 4 December 2020, 11:05 pm EST

    Hi,

    I notice the floatingObjectChanged event fires twices when you move a floating object, (once for the x value, another for the y value) and same with resizing (once of the height change and then again for width).

    I am trying to maintain a collection of actions that occurred and I would like to consider a move or resize as one action. What is the best way to do this given the floatingObjectChanged event fires twice? Is there another event I should be listening to?

    Thanks.

    Nick

  • Posted 8 December 2020, 6:18 am EST

    Hi Nick,

    This is the expected behavior from SpreadJS floatingObjectChanged event provide the propertyName arguments by which we can differentiate the actions. Please refer to the following code snippet and let us know if you face any issues.

    activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectChanged, function (
      e,
      info
    ) {
      if (info.propertyName === "height") {
        console.log("height is changed");
      }
    }); 
    

    API References:

    FloatingObjectChanged: grapecity.com/spreadjs/docs/v14/online/SpreadJS~GC.Spread.Sheets.Events~FloatingObjectChanged_EV.html

    Regards

    Avinash

Need extra support?

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

Learn More

Forum Channels