|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi,
I am using the menu system, which is bound to my site map. I am specifiying roles with the sitemap to control whether certain menu items appear.
I have a requirement to also be able to remove menu items base on particular roles. Is there any support for this?
Regards Phil Wynn
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can set each menu item's AllowRoles property and HideRoleDisabledItems to true. That way the menu can disable, then hide menu items that does not meet the roles. Note the items are not deleted.
If that can not meet your requirement. You will need to code for it. It will be something like:
Menu1.Items.RemoveAt(0);
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/3/2011 Posts: 4
|
Hello,
I'm looking at using your Treeview with the contextmenu. I have the same need as above. I have a Treeview that I want to show/hide contextmenu item based on the text of the treeview item clicked. For example, if the user clicks on an errored task I want to allow them to Requeue the task, but if the task shows Queued I don't want that option to show. Roles doesn't seem to be the best solution here. What do you suggest?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You would just modify the context menu (changing item text, show/hide items) before you show it. See here for a working example: http://demo.essentialobjects.com/Demos/TreeView/Features/Context%20Menu/Demo.aspxThis sample modifies the context menu item text to include the tree node text. You can also show/hide any context menu item. If you have not used our client side JavaScript interface before, you will want to take a look of this topic: http://doc.essentialobjects.com/library/1/clientapi_howto.aspxHope this helps. Please feel free to let us know if you have any more question. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/3/2011 Posts: 4
|
Thanks, that worked. Took me forever to find the method to call in JavsScript.
menu.getTopGroup().getItemByIndex(0).setVisible(false);
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Glad to hear it works! Please feel free to let us know if you have any more questions.
Thanks!
|
|