Copy paste using keyboard Ctrl+c/Ctrl+v in selections/range in spreadjs angular

Posted by: johina.olla on 31 October 2022, 1:16 am EST

  • Posted 31 October 2022, 1:16 am EST - Updated 31 October 2022, 1:21 am EST

    We are using the spreadjs v15 in angular applictaion and when we copy/paste cells value in spread using the keyboard command(Ctrl+c/Ctrl+v) then its paste only once but when we copy/Paste form right click option then its gets psted in the selected range or the in the selected cells.

    As you can refer the attached video. Could you please provide the piece of code to paste it according to range or as per slection as well using the keyboard commands.

  • Posted 31 October 2022, 11:47 pm EST

    Hi,

    We are sorry but we are unable to replicate this issue at our end we have tested https://www.grapecity.com/spreadjs/designer/ and it is working fine. Could you please share a working sample that replicates this issue so that we could investigate it further and help you accordingly?

    Regards,

    Avinash

  • Posted 1 November 2022, 12:57 am EST - Updated 1 November 2022, 1:05 am EST

    Hi Avinash,

    I am sharing the screen shot for both keyboard and right click option so that you can find the difference as well the sample code that we are using in our application .

  • Posted 1 November 2022, 1:13 am EST

    Hi,

    It seems like you are changing the sheet in event callback please note that if you change the sheet such as changing the cell value it will clear the internal clipboard and the paste will be handled as a global paste.

    for example, if you copy the cell that has some formula and pastes it, if the internal clipboard is cleared then the formula will not pasted only the formula’s result text will be pasted.

    Please avoid changing the sheet in pasted or pasting event call back and if the issue persists please share a working sample that replicates the issue so that we could investigate it further and help you accordingly.

    Regards,

    Avinash

  • Posted 1 November 2022, 1:23 am EST

    why do we are getting the different args object in both case in clipboradpasitng event?

    Is there any way to get them same for both ways might be in this case we can get the desired result.

  • Posted 1 November 2022, 1:23 am EST

    why do we are getting the different args object in both case in clipboradpasting event?

    Is there any way to get them same for both ways might be in this case we can get the desired result.

  • Posted 1 November 2022, 1:53 am EST

    Hi,

    This is by design, Actually, when we paste from contextmenu it works on the internal clipboard Paste, so the args like from sheet and fromRange are there that is why you are getting all the args.

    But if we paste from ctrl+v then it may possible that it is an external paste(external mean data comes from the external or gloabal clipboard provided by the browser). if the paste data is external then spreadJS does not have any information about the fromSheet and fromRange because the data come directly from the global clipboard.

    So if you change the sheet values inside the PAstign or PAsted event it will clear the internal clipboard and after all the paste will be handled has external paste.

    I hope this clarifies the issue.

    Regards,

    Avinash

  • Posted 1 November 2022, 2:42 am EST - Updated 1 November 2022, 6:20 am EST

    I understood your point but currently we have only one sheet. Still we are getting the different objects. Is there a way to programatically get the range correctly using keyboard command?

  • Posted 1 November 2022, 8:36 am EST

    Hi,

    This is not related to the number of sheets this is the spreadJs design and how it handles the paste. We are sorry but currently, there is no way by which we could achieve this functionality. We are sorry for the inconvenience.

    regards,

    Avinash

  • Posted 2 November 2022, 3:26 am EST

    As per the link provided https://www.grapecity.com/spreadjs/designer/ , it is working with both scenario. We also using the same spreadjs and events, So why it is not working at our end?

  • Posted 3 November 2022, 5:28 am EST

    HI,

    Yes, it is working in designer because in designer there is no action that is changing the sheet in the ClipboardPasting and clipboardPasted event.

    Further for better investigation, we will need a sample project that replicates this issue so that we investigate the issue and provide you with the actual cause of it/.

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels