Using Tree view to create a hierarchical structure

Hi,
I am trying to create "Equipment Heirarchy" on a perspective screen using Tree view control in the following manner.

When the page loads, one root node with node text "Equipment heirarchies" appears.
Right clicking "Equipment heirarchies" node, gives a context menu option to "Create a new equipment heirarchy".
Clicking "Create a new equipment heirarchy" option, opens a popup menu asking the following information-
1. Name of the Equipment heirarchy
2. Description
The popup will have save and cancel options.
Clicking Save button, adds a child node under root node "Equipment heirarchies".
Clicking Cancel button, closes the popup window.

Clicking on any node created as a child node of "Equipment heirarchies" node(The root node) should give a context menu option to "Create an Enterprise".
Clicking "Create an Enterprise" option, opens a popup menu asking the following information-
1. Name of the Enterprise
2. Description
The popup will have save and cancel options.
Clicking Save button, adds a child node under its parent node.
Clicking Cancel button, closes the popup window.

In the same manner, Plant, Area, Equipment will be added.

How can I achieve this?
How can I get a context menu added in the treeview control.

Thanks,
Ajay

Look in the Perspective Property Editor under META.contextMenu.

Tip: It's the "Tree" component, not "Tree view" or "Tree view control". "View" has a particular meaning in Perspective.

1 Like

This won't work here as you won't get any comtext. You'll have to call the function (requestContextMenu) to show it from a right click action, assuming that provides context of what was right clicked.

1 Like

Thank you for your response.
Let me try it.

I don't think you'll be able to do it on right click. You can do it on left click, or left click to select and then use buttons to select the action