Clipboard lost content when trying to paste cell with formula second time

Posted by: zhoubing.yang on 20 December 2022, 12:21 am EST

  • Posted 20 December 2022, 12:21 am EST - Updated 20 December 2022, 12:24 am EST

    Hi,

    In our codebase, when content is pasted, we need to set some custom style using

    updateSheet.setStyle

    When trying to paste a formula on to a cell the first time, it will paste the formula but when trying to paste the same content second time, it returns plain value instead of formula.

    Please provide me a way to fix this issue.

    Similar problem is posted here

    https://www.grapecity.com/forums/spreadjs/prevent-spread-clipboard-from-losing-its-content

    We are currently using version 15.2.1

  • Posted 21 December 2022, 5:17 am EST

    Hi,

    We are sorry but it is currently not supported. This is feature currently in our back log but we do not have ETA as of now we are sorry for the inconvenience.

    The internal Id for tracking this issue will be SJS-7977.

    Regards,

    Avinash

  • Posted 2 January 2023, 8:03 am EST

    Hi,

    You may use the suspendEvent and resumeEvent method. Please refer to the following code snippet and let me know if you face any issues.

    
    function clipboardPastedEvent(e, args) {
                    console.log("clipboardPastedEvent", args);
                    args.sheet.suspendEvent();
                    args.sheet.setArray(0, 0, [[1]]);
                    args.sheet.resumeEvent();
                    // args.sheet.setStyle(0, 0, null);
                    // args.sheet.setValue(0, 0, null);
                    // args.sheet.setStyleName(0, 0, null);
                    // args.sheet.setDataValidator(0, 0, null);
         args.sheet.suspendEvent();
                }

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels