Mar 04, 2014, 9:58 AM
[CLOSED] Dynamic menu containing button menu display problem on click
Hi guys,
I have a problem with my dynamic menu which contains an button with menu. So when I click on my dynamic menu, "Menu 1" appears but when I click on "Menu 1", it desappears.
I want my "menu 1" to not desappers on "menu 1" click but only if i click on subItem of "Menu 1". How can I do this ?
Here is my test example
index.cshtml
I have a problem with my dynamic menu which contains an button with menu. So when I click on my dynamic menu, "Menu 1" appears but when I click on "Menu 1", it desappears.
I want my "menu 1" to not desappers on "menu 1" click but only if i click on subItem of "Menu 1". How can I do this ?
Here is my test example
index.cshtml
@Html.Action("TestPartial")
TestPartial.cshtml@using Ext.Net;
@using Ext.Net.MVC;
@model Button.Config
@(
Html.X().Button(Model)
)
TestController.cs public ActionResult Index()
{
return View();
}
public ActionResult LoadMenu()
{
List<Ext.Net.ComponentBase> items = new List<Ext.Net.ComponentBase>();
Button privateButton = new Button
{
Text = "Menu 1"
};
Menu menu = new Menu();
privateButton.Menu.Add(menu);
items.Add(privateButton);
for (int i = 1; i < 6; i++)
{
MenuItem subItem = new MenuItem();
subItem.Text = string.Format("Item {0}", i);
menu.Add(subItem);
}
return Content(ComponentLoader.ToConfig(items));
}
public ActionResult TestPartial()
{
Button.Config buttonConfig = new Button.Config
{
Text = "Dynamic menu"
};
Menu menu = new Menu();
MenuItem item = new MenuItem();
item.IconCls = "x-loading-indicator";
item.CanActivate = false;
item.HideOnClick = false;
menu.Add(item);
menu.Loader = new ComponentLoader { Mode = LoadMode.Component, Url = "Test/LoadMenu", RemoveAll = true, TriggerEvent = "show", ReloadOnEvent = true };
buttonConfig.Menu.Add(menu);
return PartialView(buttonConfig);
}
Last edited by Daniil; Mar 04, 2014 at 2:26 PM.
Reason: [CLOSED]