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

Multiple context menu in treeview

4 Answers 554 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ollie
Top achievements
Rank 1
Iron
Ollie asked on 23 Oct 2018, 03:33 PM

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!

4 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 25 Oct 2018, 11:41 AM
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.
0
Ollie
Top achievements
Rank 1
Iron
answered on 25 Oct 2018, 01:37 PM

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.

0
Ivan Danchev
Telerik team
answered on 26 Oct 2018, 10:20 AM
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.
0
Ollie
Top achievements
Rank 1
Iron
answered on 29 Oct 2018, 02:37 PM

Thank you Ivan.

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

Ollie

 

Tags
TreeView
Asked by
Ollie
Top achievements
Rank 1
Iron
Answers by
Ivan Danchev
Telerik team
Ollie
Top achievements
Rank 1
Iron
Share this question
or