Sep 28, 2011, 2:40 PM
Bug adding Ext Button to a ToolBar
Hi,
I've the same problem reported for a SplitButton (http://forums.ext.net/showthread.php...5933#post65933) also for a simple Button.
Here you are the code:
Colud you have a look please?
Thanks
I've the same problem reported for a SplitButton (http://forums.ext.net/showthread.php...5933#post65933) also for a simple Button.
Here you are the code:
private void AddButton(string buttonId, string buttonText, string buttonIconCls, string[] menuItemsList)
{
Ext.Net.Button button = new Ext.Net.Button();
button.ID = buttonId;
button.Text = buttonText;
button.IconCls = buttonIconCls;
string buttonJsKey = string.Format("{0}_buttonClick", buttonId);
string addListenerJavaScript = string.Format("var {0} = function (e) {{ CompanyX.{1}();}};", buttonJsKey, AfterEditListener);
AddJavascript(buttonJsKey, addListenerJavaScript);
Ext.Net.Menu menu = new Ext.Net.Menu();
menu.ID = string.Format("{0}_{1}", "Menu", buttonId);
foreach (string menuitemName in menuItemsList)
{
Ext.Net.MenuItem menuitem = new Ext.Net.MenuItem();
//menuitem.ID = menuitemName;
//menuitem.AddListener("Click", "buttonClick");
menuitem.Text = menuitemName;
menu.Items.Add(menuitem);
}
button.Menu.Add(menu);
this.extToolBar.Items.Add(button);
}
If I include one of the following rows: menuitem.ID = menuitemName;
menuitem.AddListener("Click", "buttonClick");
the page does not work.Colud you have a look please?
Thanks