This is a migrated thread and some comments may be shown as answers.

Add Copy Paste on Context Menu

1 Answer 256 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Harlan
Top achievements
Rank 1
Harlan asked on 11 Apr 2016, 08:26 PM

We have a Kendo UI Grid that we've also defined a custom Kendo UI ContextMenu on and now we need to add Copy and possibly Paste and Cut Functionality. The issue is that when you select some text, then right click and bring up the context menu, your selection becomes cleared when you click on the Context Menu li. Is there some work-around for this?

 

We are having to do some horribly ugly stuff of copying the selection on the Menu's Activate event, copy the selected text into a hidden control, and select that text and copy it to the clipboard if they choose copy on the menu. This all seems very clumsy and like a bad work around. Is there a better way of doing this? Why does the Kendo Context Menu clear the selection? Is there some way to prevent that?

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 13 Apr 2016, 10:18 AM
Hello Harlan,

The behavior that you are describing is the browser behavior when you have selected text and you try to open a context menu by clicking outside the selection. As you can notice in the following dojo example, once you select the "Target" text, if you right-click on that selection, the context menu will be opened correctly and the selection will be preserved:
You have something different in mind, please create a dojo example that replicates the issue in question.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Menu
Asked by
Harlan
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or