I have a menu, which executes a JavaScript call on each item, rather than a link, which then makes an ajax call to update content on the page. This works, however after the menu item is clicked, the menu often stays open.
As the refresh isn't always instant (it's loading the reporting services report viewer, and then opening a report), it can look like the click hasn't registered. How can I force the menu to close after it's been clicked?
The only method I can see is a close method, but that requires passing the menu name, something that the called function isn't going to know (and as the menu is dynamically built, the item name may not be unique either).
I have tried the CloseOnClick option, but this doesn't work.
The menu definition is:-
@(Html.Kendo().Menu()
.Name("menu") //The name of the menu is mandatory. It specifies the "id" attribute of the widget.
.BindTo(Model, mappings =>
{
mappings.For<
BI_II.Models.MenuItem
>(binding => binding //define first level of menu
.ItemDataBound((item, main) => //define mapping between menu item properties and the model properties
{
item.Text = main.MenuName;
item.Url = main.FullLink;
item.ImageUrl = Url.Content("~/Images/") + main.MenuImage;
})
.Children(main => main.Children)); //define which property of the model contains the children
mappings.For<
BI_II.Models.MenuItem
>(binding => binding
.ItemDataBound((item, child) =>
{
item.Text = child.MenuName;
item.Url = child.FullLink;
item.ImageUrl = Url.Content("~/Images/") + child.MenuImage;
}));
})
.HtmlAttributes(new { style = "font-size:x-small" })
)
Thanks