TabPanel destroy raises js error

  1. #1

    TabPanel destroy raises js error

    Hi all,
    TabPanel gives js error while destroying


    Index.cshtml
    @{
     var X = Html.X();
    }
    
    @(
      X.Viewport()
       .Items(
             X.Toolbar().Docked(Dock.Top)
              .Items(
                  X.Button().Text("Tab").DirectTapAction("Tabs"), 
                  X.Button().Text("Other View").DirectTapAction("Other")
              ),
    
             X.Container().ID("Main").FitLayout()
              .Items(
                  X.Panel().Html("welcome page")
              )
        )
    )
    Tabs.cshtml
    @{
        var X = Html.X();
    }
    
    @(
        X.TabPanel()
          .Items(
                X.Panel()
                    .Title("Tab 1")
                    .Items(
                        X.TextField().Label("text 1.1"),
                        X.TextField().Label("text 1.2")
                    ),
                X.Panel().Flex(1)
                   .Title("Tab 2")
                   .Items(
                        X.TextField().Label("text 2.1"),
                        X.TextField().Label("text 2.2")
                    )
          )
    )
    other.cshtml
    @(
       X.Panel().Title("Other")
        .Items(
            X.TextField().Label("other")
        )
    )
    public ActionResult Tabs()
    {
    
         var pvr = new Ext.Net.Mobile.MVC.PartialViewResult("Main")
         {
             WrapByScriptTag = true,
             ClearContainer = true,
             RenderMode = Ext.Net.Mobile.RenderMode.AddTo,
         };
    
         return pvr;
    }
    
    public ActionResult Other()
    {
    
        var pvr = new Ext.Net.Mobile.MVC.PartialViewResult("Main")
         {
           WrapByScriptTag = true,
           ClearContainer = true,
            RenderMode = Ext.Net.Mobile.RenderMode.AddTo,
         };
    
         return pvr;
    }
    just change view by clicking buttons
    ext-mobile.axd?v=4.1.0:29358 Uncaught TypeError: Cannot read property 'ext-tab-2' of null
        at constructor.get (ext-mobile.axd?v=4.1.0:29358)
        at constructor.getComponent (ext-mobile.axd?v=4.1.0:52276)
        at constructor.remove (ext-mobile.axd?v=4.1.0:51815)
        at constructor.onItemRemove (ext-mobile.axd?v=4.1.0:91834)
        at constructor.doRemove (ext-mobile.axd?v=4.1.0:51857)
        at constructor.removeAll (ext-mobile.axd?v=4.1.0:51879)
        at constructor.destroy (ext-mobile.axd?v=4.1.0:52303)
        at constructor.doRemove (ext-mobile.axd?v=4.1.0:51860)
        at constructor.removeAll (ext-mobile.axd?v=4.1.0:51879)
        at Object.Ext.net.addTo (ext-mobile.axd?v=4.1.0:667)
  2. #2
    I guess i have found solution,
    i dont know why but somehow map property is null on Ext.util.AbstractMixedCollection.get method,
    i wrote an override to fix it, it seems work for now
    
    Ext.util.AbstractMixedCollection.override({
        get: function (key) {
            var me = this,
                mk = me.map ? me.map[key] : null, // original was, mk = me.map[key],
                item = mk !== undefined ? mk : (typeof key == 'number') ? me.items[key] : undefined;
            return typeof item != 'function' || me.allowFunctions ? item : null; // for prototype! 
        },
    });

Similar Threads

  1. [CLOSED] Error on destroy ext.window IE11
    By RCN in forum 2.x Premium Help
    Replies: 1
    Last Post: Jun 19, 2014, 4:28 AM
  2. Replies: 2
    Last Post: Apr 30, 2013, 4:30 AM
  3. Replies: 1
    Last Post: Apr 23, 2013, 6:22 PM
  4. Using multiple FormPanelFor raises error.
    By cankut in forum 2.x Help
    Replies: 1
    Last Post: Mar 10, 2013, 2:43 PM
  5. [CLOSED] [1.0] HtmlEditor js error on destroy
    By jchau in forum 1.x Premium Help
    Replies: 1
    Last Post: Jul 20, 2010, 9:09 PM

Tags for this Thread

Posting Permissions