Mar 07, 2012, 8:14 PM
[CLOSED] Issues with default namespace when panels are rendered dynamically
My Accordion menu panel is created dynamically in code and when it is about to insert the accordion in the panel I get javascript error "Microsoft JScript runtime error: 'App' is undefined" and the code stops at the code
Ext.getCmp("westPanel").add(App.ctl27)
I have already used the resource manager definition below for the page where the accordion will be inserted
Below is the code used in creating the accordion
Ext.getCmp("westPanel").add(App.ctl27)
I have already used the resource manager definition below for the page where the accordion will be inserted
<ext:ResourceManager runat="server" Namespace="">
</ext:ResourceManager>
How can I assign the namespace to the accordion panel when it is been created.Below is the code used in creating the accordion
public AjaxResult ToScript()
{
AjaxResult response = new AjaxResult();
Container m_accordion= new Container() { Layout = "Accordion" };
MenuPanel menuPanel = null;
NavigatorMenuItem navigatorMenuItem = null;
for (int i = 0; i < 5; i++)
{
menuPanel = new MenuPanel();
menuPanel.Border = false;
menuPanel.SaveSelection = false;
menuPanel.Cls = "white-menu";
menuPanel.Collapsed = false;
menuPanel.Icon = Ext.Net.Icon.ArrowMerge;
for (int g = 0; g < 4; g++)
{
MenuItem menuitem = new MenuItem();
menuitem.Icon = Ext.Net.Icon.ArrowMerge;
menuitem.Text = "sample" + g;
menuitem.CustomConfig.Add(new ConfigItem()
{Name = "passParentSize", Value = "true", Mode = ParameterMode.Raw});
menuPanel.Menu.Items.Add(menuitem);
}
menuPanel.Menu.Listeners.Click.Handler =
"Monitor.addTab({ title: menuItem.text, url: menuItem.url, icon: menuItem.iconCls, passParentSize: menuItem.passParentSize});";
m_accordion.Items.Add(menuPanel);
}
response.Script = m_accordion.ToScript(RenderMode.AddTo, "westPanel");
return response;
}
Last edited by Daniil; Mar 13, 2012 at 5:38 PM.
Reason: [CLOSED]