Aug 29, 2013, 5:35 PM
-
-
Sep 05, 2013, 12:12 PM
The same issue
Hello!
I have faced the same issue (at least with the same error message).
I do not know, how to resolve it properly, but it seems, that the following control causes such behavior: PagingToolbar. Can you please try to remove it temporary from markup and reproduce this issue?
Btw, it would be nice to get response from support team on how to workaround this! -
Sep 05, 2013, 1:47 PMWe need simple runable test case reproduces the issue. The code from first post is not runable and contains many code is not related with the issue
-
Sep 06, 2013, 10:59 AMSample is based on https://examples2.ext.net/#/XRender/...UpdateContent/
Default.aspx:
UserControl1.ascx:<%@ Page Language="C#" %> <%@ Import Namespace="System.Collections.Generic"%> <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> <script runat="server"> UserControl currentUC; protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(CurrentControl.Text)) { this.LoadUserControl(CurrentControl.Text); } } private void LoadUserControl(string num, bool update = false) { if (update && currentUC != null) { this.Panel1.ContentControls.Clear(); } currentUC = (UserControl)this.LoadControl(string.Format("UserControl{0}.ascx", num)); currentUC.ID = "UC" + num; this.Panel1.ContentControls.Add(currentUC); if (update) { CurrentControl.Text = num; this.Panel1.UpdateContent(); } } protected void Button1_Click(object sender, DirectEventArgs e) { this.LoadUserControl("1", true); } </script> <!DOCTYPE html> <html> <head runat="server"> <title>Update Controls and Content during a DirectEvent - Ext.NET Examples</title> </head> <body> <form runat="server"> <ext:ResourceManager runat="server" /> <h1>Update Controls and Content during a DirectEvent</h1> <h3>Load UserControls</h3> <ext:Hidden ID="CurrentControl" runat="server" /> <ext:Panel ID="Panel1" runat="server" Title="User Controls" Width="500" Height="700" BodyPadding="5"> <TopBar> <ext:Toolbar runat="server"> <Items> <ext:Button ID="Button1" runat="server" Text="Load 1" OnDirectClick="Button1_Click" /> </Items> </ext:Toolbar> </TopBar> </ext:Panel> </form> </body> </html>
How to reproduce an issue:<%@ Control Language="C#" %> <script runat="server"> private void BindGrid(object sender, DirectEventArgs e) { Store store = this.GridPanel1.GetStore(); store.DataSource = new Company[] { new Company{Name = "3m Co"}, new Company{Name = "Alcoa Inc"}, new Company{Name = "Altria Group Inc"}, }; store.DataBind(); } public class Company { public string Name { get; set; } } </script> <h1>№1</h1> <ext:Label ID="Label1" runat="server" Text="I am User control №1" /> <br /> <ext:Button ID="Button1" runat="server" Text="User control №1: Ext.Net button" OnDirectClick="BindGrid" /> <ext:GridPanel ID="GridPanel1" runat="server" Title="Array Grid" Width="700"> <Store> <ext:Store ID="Store1" runat="server" PageSize="10"> <Model> <ext:Model ID="Model1" runat="server"> <Fields> <ext:ModelField Name="Name" /> </Fields> </ext:Model> </Model> </ext:Store> </Store> <ColumnModel ID="ColumnModel1" runat="server"> <Columns> <ext:Column ID="Column1" runat="server" Text="Company" DataIndex="Name" /> </Columns> </ColumnModel> <View> <ext:GridView ID="GridView1" runat="server" StripeRows="true" /> </View> <BottomBar> <ext:PagingToolbar ID="PagingToolbar1" runat="server" /> </BottomBar> </ext:GridPanel>
- Launch /Default.aspx
- Click "Load 1" button
- Click "Load 1 " button again
- Expected: user control should reload correctly
- Actual result: console error message appear: "Uncaught TypeError: Cannot read property 'items' of null "
Commenting out the line 58 in UserControl1.ascx :
makes this example workable.<ext:PagingToolbar ID="PagingToolbar1" runat="server" />
Summary:
Including ext:PagingToolbar control makes impossible to use GridPanel withing dynamically loaded user control.Last edited by Bal323; Sep 06, 2013 at 11:11 AM. -
Sep 06, 2013, 11:15 AMI cannot reproduce the issue with latest code, may be it is fixed already. Please wait next public release (should be soon) and retest
-
Sep 06, 2013, 11:22 AM
-
Sep 20, 2013, 7:37 PM
Solved
Vladimir, thank for your support. Updated to last version without NuGet and solved my problem.
You can close this post.
Thank you again!
Similar Threads
-
[CLOSED] I Write code in accordance with Example ,reported Uncaught TypeError: Cannot call method 'call' of undefined
By tobros in forum 2.x Legacy Premium HelpReplies: 1Last Post: Jun 05, 2013, 11:01 AM -
[CLOSED] [2.2+] Uncaught TypeError when Showing Window with DatePicker after DirectEvent set DisabledDatesRE
By michaeld in forum 2.x Legacy Premium HelpReplies: 4Last Post: May 30, 2013, 1:36 PM -
Cannot read property 'success' of undefined (aspx + ascx) code behind
By crsodre in forum 1.x HelpReplies: 2Last Post: Apr 10, 2012, 12:08 PM -
[CLOSED] Uncaught TypeError: Object #<Object> has no method '***'
By Sevilay Tanış in forum 1.x Legacy Premium HelpReplies: 7Last Post: Mar 27, 2012, 4:44 PM -
[CLOSED] Read/Write Values to CustomConfig Items
By HOWARDJ in forum 1.x Legacy Premium HelpReplies: 2Last Post: May 19, 2010, 7:03 PM