Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    35
    Vote Rating
    0
    Patlatus is on a distinguished road

      0  

    Default Error during destroying grid panel with colllapsedMode placeholder

    Error during destroying grid panel with colllapsedMode placeholder


    REQUIRED INFORMATION
    Ext version tested:
    • Ext 4.1.3
    • Ext 4.1.1
    Browser versions tested against:
    • IE9
    • IE8
    • FF
    • Google Chrome
    Description:
    • Error during destroying grid panel with colllapsedMode placeholder.
    Steps to reproduce the problem:
    • Create a grid panel with colllapsedMode=placeholder
    • Collapse it
    • Destroy it
    • => Obtain error
    The result that was expected:
    • No error should happen
    The result that occurs instead:
    • You can notice an error.


      Actually, you can see different errors in different browsers.
      For example, in IE8

      Webpage error details


      User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)
      Timestamp: Wed, 5 Jun 2013 14:15:03 UTC




      Message: 'ownerCt' is null or not an object
      Line: 49338
      Char: 13
      Code: 0
      URI: file:///F:/Test/DestroyError/ext-all-debug.js

      In FF
      Webpage error details


      User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)
      Timestamp: Wed, 5 Jun 2013 14:15:03 UTC




      Message: 'ownerCt' is null or not an object
      Line: 49338
      Char: 13
      Code: 0
      URI: file:///F:/Test/DestroyError/ext-all-debug.js

      In Chrome

      Uncaught TypeError: Cannot call method 'remove' of undefined
      ext-all-debug.js:49338
      Ext.define.onRemoved ext-all-debug.js:49338
      Ext.define.doRemove ext-all-debug.js:40105
      Ext.define.remove ext-all-debug.js:40068
      Ext.define.destroy ext-all-debug.js:23930
      Ext.apply.destroy ext-all-debug.js:6803
      Ext.create.items.handler DestroyError.htm:53
      Ext.define.fireHandler ext-all-debug.js:42302
      Ext.define.onClick ext-all-debug.js:42292
      (anonymous function)
      wrap ext-all-debug.js:9868

      In IE9

      SCRIPT5007: Unable to get value of the property 'remove': object is null or undefined
      ext-all-debug.js, line 49338 character 13







    Test Case:
    Code:
      Ext.onReady(function() {
        Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone'],
        data:{'items':[
            { 'name': 'Lisa',  "email":"lisa@simpsons.com",  "phone":"555-111-1224"  },
            { 'name': 'Bart',  "email":"bart@simpsons.com",  "phone":"555-222-1234" },
            { 'name': 'Homer', "email":"home@simpsons.com",  "phone":"555-222-1244"  },
            { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254"  }
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    
        var gp = Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            { text: 'Name',  dataIndex: 'name' },
            { text: 'Email', dataIndex: 'email', flex: 1 },
            { text: 'Phone', dataIndex: 'phone' }
        ],
            collapsible: true,
            collapseMode: 'placeholder',
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });    
    
    
    Ext.create('Ext.panel.Panel', {
            items : [{
                xtype: 'button',
                text: 'destroy',
                handler : function() {
                    gp.collapse();
                    alert('Grid panel collapsed');
                    Ext.destroy(gp);
                    alert('Grid panel destroyed');
                }
            }, gp],
            renderTo: Ext.getBody()
        });
    });
    HELPFUL INFORMATION
    Screenshots:
    • attached
    See this URL for live test case: http://jsfiddle.net/Patlatus/pJmp2/
    Debugging already done:
    • none
    Possible fix:
    • not provided
    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • Win7
    Attached Images

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,681
    Vote Rating
    112
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    Hi Patlatus,

    this bug is already fixed in 4.2.1.

    Take a look at Ext.panel.Panel:
    Code:
        onRemoved: function(destroying) {
            var me = this;
    
            me.callParent(arguments);
    
            if (me.placeholder && !destroying) {
                me.ownerCt.remove(me.placeholder, false);
            }
        }
    Just override this method and move the callParent to the bottom in case you want to stick with 4.1.
    Code:
        onRemoved: function(destroying) {
            var me = this;
    
            if (me.placeholder && !destroying) {
                me.ownerCt.remove(me.placeholder, false);
            }
    
            me.callParent(arguments);
        }
    Best regards
    tobiu
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

Thread Participants: 1

Tags for this Thread