Could not Undo when I clear cell format

Posted by: timzod on 29 September 2018, 5:18 am EST

    • Post Options:
    • Link

    Posted 29 September 2018, 5:18 am EST

    Hi,

    This problem occurred in https://www.grapecity.com/en/demos/spread/JS/InspectorSample/

    I click the “Clear” button on toolbar to clear the data or format(such as bgcolor…) of selected cells.

    (it use sheet.clear() and sheet.removeSpan() function)

    Then Ctrl+Z , but the undo does not work to recover the data or format just cleared.

    I know that the contextmenu “clear contents” can clear data only and undo successfully.

    (it use spread.commandManager().execute({ cmd: “clearValues”, sheetName: name, ranges: [range] }):wink:

    anyone can tell me how to UNDO the format modification through API?

    Thanks

  • Posted 1 October 2018, 7:41 am EST

    Hello,

    You will need to write a custom command and register the same for undo. Please refer to the attached sample application.

    Thanks,

    Deepak SharmacustomActionUndo.zip

  • Posted 9 October 2018, 4:28 am EST

    Yes, I should use startTransaction() and endTransaction() to handle that logic.

    Thank you , deepak !

Need extra support?

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

Learn More

Forum Channels