Event name is misleading for undo/redo operations

Posted by: davide.vago on 25 July 2019, 12:03 pm EST

  • Posted 25 July 2019, 12:03 pm EST

    Good morning/afternoon.

    Following up the post: https://www.grapecity.com/forums/spread-sheets/events-on-new-rowcolumn#original-post.

    Adding/removing rows and columns and listening with the event listeners as RowChanged, ColumnChanged the triggered event has an expected meaningful name (e.g. addRows or deleteRows), however this doesn’t apply when the action from the user is Undo/Redo, in fact, these actions always trigger an event called DeleteColumns.

    How to reproduce the issue:

    Create a new instance of spreadsheet with a sheet.

    Attach 2 listeners e.g.

    
       spreadInstance.bind(GC.Spread.Sheets.Events.RowChanged, onRowColChange)
          spreadInstance.bind(GC.Spread.Sheets.Events.ColumnChanged, onRowColChange)
    
    

    log (e, info) as arguments of the function

    onRowColChange

  • Posted 26 July 2019, 3:10 am EST

    Hi,

    We are able to replicate the issue at our end and hence we have forwarded it to the concerned team for further investigation. The internal tracking ID for the issue is SJS-1117. We will let you know about any updates regarding the same.

    In the meantime, you may compare oldValue and newValue to determine if the operation is an undo operation. If the newValue is greater than the oldValue than it is undo operation. The workaround would not work for some edge cases like when all columns are deleted.

    function onRowColChange(e, info){
    	var isUndo = info.newValue > info.oldValue;
    }
    

    Regards

  • Posted 27 November 2019, 4:49 am EST

    Hi Davide,

    This issue is fixed in the build 12.2.5, please update to the latest build and let us know if the issue persists for you.

    Regards

Need extra support?

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

Learn More

Forum Channels