Rank: Newbie Groups: Member
Joined: 10/12/2007 Posts: 8
|
I would like to create a context menu which is dynamic with regards to the nodes on the tree. So there are nodes named students and counsellors. I would like to create a context menu for each student and counsellor. I am able to create a cotext menu with the example provided by the "Demo version" but the same context menu appears for all the nodes. i wish to have 2 context menu's namely for the two type of nodes "students and counsellors. Any Suggestion recieved would be helpful
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Check the source code of the demo, you will notice the context menu is displayed by calling eo_ShowContextMenu. All you need to do is to give it a different menu ID based on whatever condition you may have. For example, you can have the top level has one context menu and all other levels to use a different context menu:
Code: JavaScript
function ShowContextMenu(e, treeView, node)
{
if (node.getLevel() == 0)
eo_ShowContextMenu(e, "Menu1");
else
eo_ShowContextMenu(e, "Menu2");
}
Thanks
|