Add Copy Paste on Context Menu

2 posts, 0 answers
  1. Harlan
    Harlan avatar
    19 posts
    Member since:
    Dec 2014

    Posted 11 Apr 2016 Link to this post

    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?

  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 13 Apr 2016 Link to this post

    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.

    Konstantin Dikov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top