Issue with undo/redo actions

Posted by: asefaw.mekuria on 19 June 2021, 5:56 pm EST

    • Post Options:
    • Link

    Posted 19 June 2021, 5:56 pm EST

    We have implemented undo/redo actions manually by associating them with Buttons. however when clicking the the undo or redo buttons. it undo changes across multiple sheets. for example if i copy and paste celss on 3 sheets on a workbook and clcik undo, it reverts changes on all sheets. but th expectation is to undo redo on the activesheet only. i’m wondering, is there is another way to implement undo/redo. below is the code we used.

    
    const spread = GC.Spread.Sheets.findControl(document.getElementById('ss'));
    spread.undoManager().undoManager.undo();
    
    

    Thank you!

  • Posted 19 June 2021, 5:58 pm EST

    correction to the code part.

    
    const spread = GC.Spread.Sheets.findControl(document.getElementById('ss'));
    spread.undoManager.undo();
    
    
  • Posted 21 June 2021, 8:42 am EST

    HI Asefaw,

    We are sorry but this is by design. SpreadJS matches Excel policy for the undo-redo functionality. Internally the spreadJS maintains one stack on workbook level and share it among all sheet. You may check the undo stack by calling the getUndoStack method.

    For more information regarding the undoRedo Stack please refer to the following demo.

    undoRedoStack:

    https://www.grapecity.com/spreadjs/demos/features/worksheet/actions/undo-manager/purejs

    Regards

    Avinash

Need extra support?

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

Learn More

Forum Channels