PDA

View Full Version : [CLOSED] Page has DataViewAnimated plugin in DataView; then I replace DV's parent Container in DirectEvent causes endless except



michaeld
Jan 13, 2014, 11:39 PM
Chrome reports "[E] TypeError: Cannot call method 'applyStyles' of null" and infinitely repeats.

I've managed to trap where the original exception. The stack looks like this:


doAnimate (VM3553:15)
Ext.define.onTick (ext-all-dev.js:14139)
(anonymous function) (ext-all-dev.js:3316)


This leads me to believe that plugin is not properly destroyed in the parent tree and is still trying to trigger the animation event even though the object is no longer on the page. I do not know if this is limited to this plugin or this is a general cleanup problem. I thought I'd let you know about the problem in this case though.

Daniil
Jan 14, 2014, 5:31 AM
Hi @michaeld,

Could you, please, demonstrate what exactly you do?

then I replace DV's parent Container in a DirectEvent

Not a full sample, just this concrete moment.

michaeld
Jan 14, 2014, 9:30 AM
Could you, please, demonstrate what exactly you do?
Not a full sample, just this concrete moment.

On first Page_Load, I create and populate a panel ViewP with the DataView with DaveViewAnimaged plug-in.

On clicking of a button listener, I call a DirectMethod that refreshes ViewP (with a ReRender call) after only adding a label to its items (keep in mind the Page_Load skips the original population if X.IsAjaxRequest, so only the label is a child in ViewP).

I think that should be enough to reproduce it.

The issue appears after the response script has run.

Daniil
Jan 14, 2014, 11:54 AM
I cannot reproduce.


Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Panel1.Items.Add(new DataView()
{
Store =
{
new Store()
{
Model =
{
new Model()
{
Fields =
{
new ModelField("test")
}
}
},
DataSource = new object[]
{
new object[] { "test1" },
new object[] { "test2" },
new object[] { "test3" }
}
},
},
ItemSelector = "div.my-item",
Tpl = new XTemplate()
{
Html = "<tpl for=\".\"><div class=\"my-item\">{test}</div></tpl>"
},
Plugins =
{
new DataViewAnimated()
}
});
}
}

protected void ReRender(object sender, DirectEventArgs e)
{
this.Panel1.Items.Add(new Ext.Net.Label("Label"));
this.Panel1.ReRender();
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-item {
height: 50px;
width: 50px;
border: 1px solid;
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Button runat="server" Text="ReRender" OnDirectClick="ReRender" />

<ext:Panel
ID="Panel1"
runat="server"
Title="Animated DataView"
Height="555"
Width="650"
Layout="FitLayout" />
</form>
</body>
</html>

michaeld
Jan 14, 2014, 8:47 PM
Alright, I appreciate the time you've taken. I'll see what I can do to produce a sample.