Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi,
I am binding a menu to a site map. The site map uses the Rolls attribute to dynamically select the menu items that are visible for the current user. I have several menu items that have no url, and are used simply to allow access to a sub-menu.
The problem I have is that there are situations where no items in a sub-menu are available to a particular user. In this case, I do not want to be displaying the sub-menu parent item, as it has no purpose.
How can I achieve this? When I handle the menu.preRender event, it states that all menu items are visible (even when they are not rendered!).
Regards Phil
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
The items are disabled based on the role info on the last minute before the menu is rendered, so there is no way for you to do anything after that. The only option seems to be walk through all child items and perform the same check as the menu item performs with the role, then set the parent menu item's Visible property.
Thanks
|