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

Radmenu Submenu not collapsing

3 Answers 179 Views
Menu
This is a migrated thread and some comments may be shown as answers.
HKJ
Top achievements
Rank 1
HKJ asked on 14 Jun 2016, 12:30 PM

Hi,

My page had two frames and the top frame has Radmenu, as a top navigation and the corresponding pages are displayed in the bottom frames

Some of the menu has got sub menu. The problem is the sub menu options are not collapsing even if taget page is loaded in the bottom frame.

I want the menu to collapse immediately after clicking or on mouse out. I tried OnClientMouseOut event and OnClientItemClicked event, but didnt work.

Looking forward to hear from you.

 

 

Regards,

Hari

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 15 Jun 2016, 02:25 PM
Hello Hari,

Have you tried collapsing the items by calling the Menu's close() client-side method? If you have and the items are not collapsing could you isolate the Menu to a sample runnable page that demonstrates your scenario and post your markup and client-side methods, so we can further investigate the behavior of the control?

Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
HKJ
Top achievements
Rank 1
answered on 16 Jun 2016, 10:09 AM

Dear Ivan,

 

Thank you for your reply. I am using :

OnClientMouseOut="OnClientMouseOut"

 

 and the function is 

function OnClientMouseOut(sender, args) {
       args.get_item().close();
   }  

 

My menu is

<telerik:RadMenu ID="RMenu" runat="server" Skin="Vista" EnableRoundedCorners="true" CollapseAnimation-Type ="None"  EnableShadows="true" CssClass="menu" style="top: -22px;z-index:99999 ;" OnClientMouseOut="OnClientMouseOut" >
                            </telerik:RadMenu>

 

I am thinking the issue is because of the two frames. If I can getting something to collapse sub menu as soon as my mouse move out, its wonderful.

 

I am attaching the screenshot along with this. I have selected the submenu (in Frame 1)  which I have circled red in screenshot and the target page is loaded in the Frame 2, but still the menu is not collapsing.

I hope this pictures gives you an idea.

Regards,

Hari

 

0
Ivan Danchev
Telerik team
answered on 20 Jun 2016, 01:06 PM
Hello Hari,

Instead of OnClientMouseOut I would suggest using the Menu's OnClientItemClick event for closing the items on click and the document's mouseleave event for closing the Menu is the user leaves the iframe:
<telerik:RadMenu ID="RMenu" runat="server" CollapseAnimation-Type="None" EnableShadows="true" CssClass="menu" Style="z-index: 99999;" OnClientItemClicked="OnClientItemClicked">

function OnClientItemClicked(sender, args) {
    if (args.get_item().get_level() != 0) {
        args.get_item().get_parent().close();
    }
}
 
$telerik.$(document).mouseleave(function () {
    var menu = $find("<%=RMenu.ClientID%>");
    menu.close();
});

Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Menu
Asked by
HKJ
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
HKJ
Top achievements
Rank 1
Share this question
or