[OPEN] [#221] Store in Partial View Raises JS Error for Destroy

  1. #1

    [OPEN] [#221] Store in Partial View Raises JS Error for Destroy

    Hi

    Applying second click of the following aspx raises JS error (screenshot attached).
    Please check.

    (index.aspx)
    <%@ Page Language="C#" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <body id="theBody">
        <ext:ResourceManager runat="server" />
        <ext:Container runat="server" ID="c" />
        <ext:Button runat="server" Text="Inject (apply second click)">
            <DirectEvents>
                <Click Url="/test.aspx/test" />
            </DirectEvents>
        </ext:Button>
    </body>
    </html>
    (control.ascx)
    <%@ Control Language="C#" %>
    <ext:Window runat="server" ID="win">
        <Bin>
            <ext:Store runat="server" ID="ds" AutoLoad="false">
                <Model>
                    <ext:Model runat="server">
                        <Fields>
                            <ext:ModelField Name="newId" />
                        </Fields>
                    </ext:Model>
                </Model>
                <Proxy>
                    <ext:AjaxProxy Url="/test.aspx/getstore">
                        <ActionMethods Read="POST" />
                        <Reader>
                            <ext:JsonReader Root="data" TotalProperty="total" MessageProperty="message" />
                        </Reader>
                    </ext:AjaxProxy>
                </Proxy>
            </ext:Store>
        </Bin>
        <Buttons>
            <ext:Button runat="server" Text="Close">
                <Listeners>
                    <Click Handler="#{win}.close();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    (controller "test")
    
            public ActionResult Index()
            {
                return View(@"~/test/index.aspx");
            }
    
    
            public ActionResult Test(string id)
            {
                Ext.Net.MVC.PartialViewResult r = this.PartialExtView("~/test/control.ascx");
                return r;
            }
    Attached Thumbnails Click image for larger version. 

Name:	error.jpg 
Views:	22 
Size:	70.5 KB 
ID:	6118  
    Last edited by Daniil; Apr 30, 2013 at 4:30 AM. Reason: [OPEN] [#221]
  2. #2
    Hi @cleve,

    Thank you for the report. We are investigating a possible fix.

    For now please use the following fix. You should place it into the page's <head>.

    Fix
    Ext.destroy = function () {
        var ln = arguments.length,
            i, arg;
    
        for (i = 0; i < ln; i++) {
            arg = arguments[i];
            if (arg) {
                if (Ext.isArray(arg)) {
                    this.destroy.apply(this, arg);
                } else if (Ext.isFunction(arg.destroyStore)) {
                    arg.destroyStore();
                } else if (Ext.isFunction(arg.destroy)) {
                    arg.destroy();
                } else if (arg.dom) {
                    arg.remove();
                }
            }
        }
    };
  3. #3
    It has been fixed in SVN, you can remove a temporary fix that I suggested.

    Anyway, I reported to Sencha.
    http://www.sencha.com/forum/showthread.php?262480

    And they opened a bug ticket.

    If they fix it, we can review our fix. Created an Issue to monitor.
    https://github.com/extnet/Ext.NET/issues/221

Similar Threads

  1. [CLOSED] FileUploadField Raises Server Error in Partial View (MVC)
    By cleve in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 23, 2013, 6:22 PM
  2. [CLOSED] Partial View Error
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 10, 2012, 10:32 AM
  3. [CLOSED] Error loading partial view in Tab.
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 20, 2011, 8:00 PM
  4. Partial View Error inside TabPanel
    By David Pelaez in forum 1.x Help
    Replies: 1
    Last Post: Feb 07, 2011, 3:08 PM
  5. Can't add record to store from partial view
    By craig2005 in forum 1.x Help
    Replies: 14
    Last Post: Jan 05, 2011, 11:59 PM

Posting Permissions