[CLOSED] Error on destroy ext.window IE11

  1. #1

    [CLOSED] Error on destroy ext.window IE11

    I have a window with closeAction set to 'destroy'. When the window is closed, an exception is thrown on IE 11, as shown below:

    SCRIPT5007: Unable to get value of the property 'app' object is null or undefined
    File: Index2 Line: 515 Column: 9



    ExampleController.cs

    public class ExampleController : System.Web.Mvc.Controller
    {
        public ActionResult Index2()
        {
            FormPanel frm = new FormPanel();
            frm.FieldDefaults.LabelAlign = LabelAlign.Top;
    
            FileUploadField fuf = new FileUploadField();
    
            Button _btnClose = new Button
            {
                Text = "Close"
            };
            _btnClose.Listeners.Click.Handler = "parentAutoLoadControl.close();";
    
            Toolbar tbar = new Toolbar();
            tbar.Items.Add(_btnClose);
            frm.TopBar.Add(tbar);
    
            ViewBag.Content = ComponentLoader.ToConfig(frm);
    
            return View();
        }
    
        public ActionResult Index3()
        {
            return View();
        }
    }
    Index2.aspx

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
    
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    </head>
    <body>
        <%--Conte?do da Aplica??o--%>
        <ext:Hidden ID="_hdnContent" Text="<%# ViewBag.Content %>"
            AutoDataBind="true" runat="server" />
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Viewport ID="_vwp1" Layout="FitLayout" Border="false" runat="server" />
        <script type="text/javascript">
            Ext.onReady(function () {
                App._vwp1.add(Ext.decode(App._hdnContent.value, true));
                
                App._hdnContent.destroy();
            });
        </script>
    </body>
    </html>
    Index3.aspx

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Index3</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <script type="text/javascript">
            Ext.onReady(function () {
                var wdw = new Ext.Window(
                {
                    width: 400,
                    height: 400,
                    closable: false,
                    modal: true,
                    closeAction: "destroy",
                    loader: {
                        renderer: "frame",
                        url: Ext.net.ResourceMgr.resolveUrl("~/Example/Index2"),
                        loadMask: {
                            showMask: true
                        }
                    }
                });
    
                wdw.show();
            });
        </script>
    </body>
    </html>
    Last edited by Daniil; Jun 24, 2014 at 2:14 PM. Reason: [CLOSED]
  2. #2
    Hi Raphael,

    Yes, such a scenario might causes problems and it might depend on a browser. In IE the iframe is already destroyed by the time Ext.NET/ExtJS finishes the click event.

    I can suggest the following as a solution.
    _btnClose.Listeners.Click.Handler = "Ext.defer(function() { parentAutoLoadControl.close(); }, 1);";

Similar Threads

  1. Editor and window destroy
    By Yannis in forum 2.x Help
    Replies: 4
    Last Post: Dec 12, 2013, 4:52 AM
  2. [CLOSED] js error btn undefined after destroy() of container?
    By ViDom in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: May 21, 2013, 2:24 PM
  3. Question about Window Destroy
    By rammus in forum 2.x Help
    Replies: 4
    Last Post: Mar 25, 2013, 12:15 PM
  4. [CLOSED] Destop Window Destroy load Problem
    By ogokgol in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 01, 2011, 5:41 AM
  5. [CLOSED] [1.0] HtmlEditor js error on destroy
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 20, 2010, 9:09 PM

Posting Permissions