Posted 9 October 2017, 11:30 am EST
Hello. When I copy or cut a cell I get dashed bordered cell. Is there a way to get this cell from which I copied or cutted? I’m trying to find out if there a copy/cut action was made on the grid.
Thanks.
Forums Home / Spread / SpreadJS
Posted by: lpagliaro on 9 October 2017, 11:30 am EST
Posted 9 October 2017, 11:30 am EST
Hello. When I copy or cut a cell I get dashed bordered cell. Is there a way to get this cell from which I copied or cutted? I’m trying to find out if there a copy/cut action was made on the grid.
Thanks.
Posted 10 October 2017, 11:43 am EST
Hello,
You can handle the ClipboardPasting or ClipboardChanging event to know whenever a clipbaord paste happens within Spread.Sheets.
There are other useful clipboard event which you can take a look here:
http://help.grapecity.com/spread/SpreadSheets10/webframe.html#JavascriptLibrary~GC.Spread.Sheets.Events.html
Thanks,
Deepak Sharma
Posted 10 October 2017, 1:28 pm EST
That’s not what I’m looking for. Basically, we only want to allow a paste operation if a copy or cut was made from the spreadsheet grid, not from an external source. So I wanted to know if it is possible to check if that copy/cut selection could be retrieved. The events you suggested would only allow us to create a custom flag for this copy/cut selection.
Posted 11 October 2017, 10:28 am EST
Hello,
In this case you work with the ClipboardChange or ClipboardChanging event. These event fires when the Clipboard change occurs that affects Spread.Sheets.
In this event you can set a flag and check in ClipboardPasting event. You can also check for the copyData which you can get from ClipboardChanged event.
Thanks,
Deepak Sharma
Posted 11 October 2017, 11:53 am EST
Yes, just the way we have it now. Thanks fot the answer.
Greetings.
Posted 23 October 2017, 11:44 pm EST
Hello,
We are glad to know that your issue has been resolved.
Thanks,
Reeva
Posted 13 February 2020, 2:50 pm EST
how to know if whats specific item on the clipboard was click ? what if cut or copy or paste or clear contents ? is there any way to detect this action ?
Posted 14 February 2020, 5:02 am EST
Hi Jerome,
If I understand correctly, you need to handle it when an item from the context menu is clicked. There is no inbuilt event for this but we could override the getCommandOptions method of the MenuView to achieve the required functionality. Please refer to the following sample which demonstrates the same and let us know if this doesn’t work for you:
https://codesandbox.io/s/spread-js-starter-d7vbx
Regards
Sharad
Posted 14 February 2020, 10:26 am EST
@Sharad Thanks
, i try that one
Posted 17 February 2020, 10:48 am EST