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

  1. #1

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

    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.
    Last edited by Daniil; Jan 21, 2014 at 4:45 AM. Reason: [CLOSED]
  2. #2
    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.
  3. #3
    Quote Originally Posted by Daniil View Post
    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.
    Last edited by michaeld; Jan 14, 2014 at 10:02 AM.
  4. #4
    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>
  5. #5
    Alright, I appreciate the time you've taken. I'll see what I can do to produce a sample.

Similar Threads

  1. Replies: 6
    Last Post: Nov 27, 2013, 6:37 AM
  2. Replies: 2
    Last Post: Apr 18, 2013, 2:49 AM
  3. [CLOSED] Open parent window from child page using DirectEvent?
    By tjshin in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 15, 2012, 2:25 PM
  4. [CLOSED] Open window in a parent container
    By edigital in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 18, 2011, 5:21 PM
  5. [CLOSED] Multiselect does not fits parent container
    By armadalabs in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 05, 2010, 3:32 PM

Posting Permissions