This is a migrated thread and some comments may be shown as answers.

Hiding and Showing menu item

4 Answers 180 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Ric
Top achievements
Rank 1
Ric asked on 28 Apr 2008, 03:56 PM

The code below is not working for some reason. The intent is if a user clicks the main menu check the value in the cb dropdown and hide/show a menu item. But the menu item is not hiding and displaying like I expect. Any ideas?

///////////////////////////////////////////////////

<

telerik:RadMenu ID="menuSettings" runat="server" OnClientItemClicking

=MenuItemClicking>

////////////////////////////////////////////////

function MenuItemClicking()

{

debugger;

var cb= $find("<%=cb.ClientID%>");

if (cb._selectedIndex==0)

ItemVisibility(

"ShowHideEmptyBeds",false);

else

 ItemVisibility("ShowHideEmptyBeds",true);

}

function

ItemVisibility(menuText,visibility)

{

var menu = $find("<%= menuSettings.ClientID %>");

var menuItem = menu.findItemByText(menuText);

if(menuItem && (menuItem.get_visible()!=visibility))

{

menuItem.set_visible(visibility);

}

}

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Apr 2008, 10:19 AM
Hi Ric,

Go through the KB article "Hiding RadMenu or RadMenu items on the client" for getting more information about how to hide/show the menu item from client side.

Shinu.
0
Ric
Top achievements
Rank 1
answered on 29 Apr 2008, 10:34 AM
Unfortunately that does not work for me.The menuitem is made up of Itemtemplate with a group of radio buttons. What happens is that the radiobuttons still appear when I call the hide() function.
0
Ric
Top achievements
Rank 1
answered on 29 Apr 2008, 10:34 AM
Unfortunately that does not work for me.The menuitem is made up of Itemtemplate with a group of radio buttons. What happens is that the radiobuttons still appear when I call the hide() function.
0
T. Tsonev
Telerik team
answered on 29 Apr 2008, 02:47 PM
Hello Ric,

Thank you for reporting this issue. We have managed to reproduce the problem and fix it. Please, open a formal support ticket, so we can send you a hotfix. Your Telerik points have been updated for your involvement.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Menu
Asked by
Ric
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ric
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or