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

Automatically close the menu on click

7 Answers 180 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Luca B
Top achievements
Rank 1
Luca B asked on 17 Nov 2010, 10:29 AM
Hi there,
I have a RadMenu with several menu items. I want to automatically close the menu when the user clicks a menu item, regardless the level of the menu item itself.
I have seen this post http://www.telerik.com/community/forums/aspnet-ajax/menu/closing-menu-in-onclientitemclicked-re-opens.aspx but it actually doesn't work: the menu is closed and then reopened. This is a serious issue for us when accessing our application on an iPad.
Can you tell me how to achieve this?
On a side note, why should I want a menu that stays open once I click on an item??? I am not able to think any use of this, nor I can think of an application that actually does this.
Before you ask, yes, I am suggesting to at least have a property that handles this, without reverting to custom code :-)

Luca

7 Answers, 1 is accepted

Sort by
0
Luca B
Top achievements
Rank 1
answered on 18 Nov 2010, 03:55 PM
I don't understand, am I the only one who has this problem?
I simply want the behavior I already see in a context menu: I click on an item, the related code is executed, the menu is closed.
Any ideas?
0
Rhyss
Top achievements
Rank 1
answered on 19 Nov 2010, 06:30 AM
I am having a similar issue regarding launching a radwindow from the clientside click of the menu item.  I have changed the z-index values so that the window will draw over the menu, but the menu will remain on top of the window until the mouse leaves the level of the menu item clicked.

i hope there is a solution to this.
0
Yana
Telerik team
answered on 19 Nov 2010, 04:33 PM
Hello there,

Luka, 

actually the context menu is supposed to close when an item is clicked, I cannot tell what is the reason for this issue in your case without sample code.

Jordan,

Have you checked this help article regarding z-index?

Kind regards,
Yana
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Luca B
Top achievements
Rank 1
answered on 19 Nov 2010, 05:00 PM
I will check the article, but my problem is related to menus, not context menus.
I only wanted to point out the behavior I'd like to have for my menus, that is the one I see for context menus.

Luca

OK, I checked and I don't get how setting z-index could help me.
0
Luca B
Top achievements
Rank 1
answered on 23 Nov 2010, 11:10 AM
Hi again,
is there anyone that can help me? I do not want to write tons of JS to fix something you probably can fix in a second.
No one else has this problem?

Thanks
0
Luca B
Top achievements
Rank 1
answered on 01 Mar 2011, 10:59 AM
Here I am again.
I still have no solution for this problem. As you can see in the attached pictures, when I click a menu item (Customer Detail, in this case) the corresponding form is shown (in an IFRAME) but the menu remains open.
I admit this is also the default behavior on regular browsers (not only on iPad), but on regular browsers I have the hover event that automatically closes the menu, while this event is unavailable on iPad.
Can you please advice on this? I tried using the menuitem.close method, but the menu is first closed and the reopened.
Thanks
Luca
0
Yana
Telerik team
answered on 02 Mar 2011, 04:17 PM
Hello Luca,

I guess that you've set NavigateUrl and Target properties of the menu items - that's why you experience this behavior, is that the case? Could you please try to subscribe to OnClientItemClicked event of the menu and add the following code:

<script type="text/javascript">
    function itemClicked(sender, args) {
        setTimeout(function() { args.get_item().close(); }, 100);
    }
</script>

Let us know how it goes.

All the best,
Yana
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Menu
Asked by
Luca B
Top achievements
Rank 1
Answers by
Luca B
Top achievements
Rank 1
Rhyss
Top achievements
Rank 1
Yana
Telerik team
Share this question
or