Multiple context menu in treeview

5 posts, 0 answers
  1. Ollie
    Ollie avatar
    21 posts
    Member since:
    Oct 2016

    Posted 23 Oct 2018 Link to this post

    I found a similar thread for this but the solution is for ASP.Net and for a RadTreeView (https://www.telerik.com/forums/119788-multiple-context-menu-in-radtreeview).

    How can i implement this using jQuery and a TreeView?

     

    Thanks!

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2105 posts

    Posted 25 Oct 2018 Link to this post

    Hello Ollie,

    Here's a dojo example, which demonstrates a possible approach for opening one ContextMenu on clicking a node's text and another menu on clicking elsewhere within the widget. The purpose of calling the close method in both menus' open event handlers is to close the other ContextMenu and to avoid having two menus open at the same time.

    Regards,
    Ivan Danchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Ollie
    Ollie avatar
    21 posts
    Member since:
    Oct 2016

    Posted 25 Oct 2018 in reply to Ivan Danchev Link to this post

    Hi Ivan!

    Thank you for the source code! I am just wondering on how I can do the context menu on nodes. In your example, you have to right click on two different parts of the treeview to display the respective context menu.

    What I am trying to achieve is, right-click on a node, get the item, check 'type' and from there display the related context menu.

    Thank you for your help.

  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2105 posts

    Posted 26 Oct 2018 Link to this post

    Hello Ollie,

    If you want the ContextMenu items shown to depend on some node data, for example "type", you can do so as demonstrated in this dojo example. A single ContextMenu is used, but it is loaded with different data depending on the node's type value.

    Regards,
    Ivan Danchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Ollie
    Ollie avatar
    21 posts
    Member since:
    Oct 2016

    Posted 29 Oct 2018 in reply to Ivan Danchev Link to this post

    Thank you Ivan.

    I managed to achieve what I am trying to do based on your last example.

    Ollie

     

Back to Top