Apr 19, 2013, 10:17 PM
2.2 - Store name is undefined when ascx is loaded
Hi all,
Im posting a sample of my problem here.
I have a simple tab panel and when someone click on button or menu open an usercontrol ascx in panel. But something is wrong store name is undefined, no matter what store is.. i tried with gridpanel and a simple combo box.
I think it is a bug.
Im using the lastest release published at nuget 2.2
Look the minified code.
Aspx.
error:
Unable to get property 'proxy' of undefined or null reference
App.ctl13_Store1 is undefined.
How can i solve that?
Regards.
Im posting a sample of my problem here.
I have a simple tab panel and when someone click on button or menu open an usercontrol ascx in panel. But something is wrong store name is undefined, no matter what store is.. i tried with gridpanel and a simple combo box.
I think it is a bug.
Im using the lastest release published at nuget 2.2
Look the minified code.
Aspx.
<%@ Page Language="C#" AutoEventWireup="true" Inherits="IWATrading.BackOffice.Carrion.WebForm1" %>
<script runat="server">
protected void AdicionarTab(object sender, DirectEventArgs e)
{
var control = new UserControlLoader { Path = "comboBox.ascx" };
var panel = new Ext.Net.Panel
{
Title = "combo",
Layout = "Fit",
};
panel.Items.Add(control);
this.tabpanel1.Items.Add(panel);
panel.Render();
}
</script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager runat="server" />
<form id="form1" runat="server">
<ext:Button runat="server" OnDirectClick="AdicionarTab" Text="OpenNewTab"/>
<ext:TabPanel runat="server" ID="tabpanel1" />
</form>
</body>
</html>
<ext:XScript ID="XScript1" runat="server">
<script>
var addTab = function (tabPanel, id, url, menuItem) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id: id,
title: url,
closable: true,
menuItem: menuItem,
Layout: 'Fit',
loader: {
url: url,
renderer: "frame",
loadMask: {
showMask: true,
msg: "Loading " + url + "..."
}
}
});
}
;
tabPanel.setActiveTab(tab);
}
</script>
</ext:XScript>
usercontrol comboBox.ascx<%@ Control Language="C#" AutoEventWireup="true" Inherits="IWATrading.BackOffice.Carrion.comboBox" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Store1.DataSource = new object[] {
new object[] { "ID", "ID" },
new object[] { "ImageUrl", "ImageUrl"},
new object[] { "Description", "Description"},
new object[] { "Preco", "Preco"},
new object[] { "Nome", "Nome"}
};
Store1.DataBind();
}
</script>
<ext:ComboBox ID="cboReorder" runat="server" Editable="false"
DisplayField="display" ValueField="value">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="display" />
<ext:ModelField Name="value" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
error:
Unable to get property 'proxy' of undefined or null reference
App.ctl13_Store1 is undefined.
How can i solve that?
Regards.