Welcome Guest Search | Active Topics | Sign In | Register

Dynamic context menu on a tree view node Options
tresa
Posted: Friday, October 12, 2007 5:12:53 PM
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
eo_support
Posted: Friday, October 12, 2007 5:30:22 PM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.