Results 1 to 4 of 4

Thread: this.getContainer().destroy() throws an error

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3181 in a recent build.
  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    -1
      0  

    Default this.getContainer().destroy() throws an error

    REQUIRED INFORMATION

    Sencha Touch version tested:
    • Sencha Touch 2.1.0 BETA 1

    Browser versions tested against:
    • newest Chrome
    • IOS 5.0.1

    Description:
    • When i use .destroy() on a Container with a NavigationView and a Carusel
      (with 2 items: FormPanel and a ListView)
      ill get the following error: Uncaught TypeError: Cannot call method 'getAutoDestroy' of null

    Steps to reproduce the problem:
    • Create a Container
    • Create a NavigationView
    • Create a Carusel
    • Add 2 items to the Carusel (FormPanel and a ListView)
    • Fill the form with .setValues(data) or .setData(data) and fill the list with .setData(data)
    • .destroy() the container
    • Try to readd it and refill it with:
      Code:
      if (this.getProperties()) {
        this.getProperties().destroy();
      }
      this.getNavigation().setActiveItem({
        xtype: 'properties',
        itemId: this.id.toLowerCase() + 'Properties',
        title: this.id
      });
      this.getProperties().setActiveItem(0);
    • after one or two times... the error shows

    The result that was expected:

    • the form should be destroyable and be shown without errors

    The result that occurs instead:
    • an error throws when the form gets one time destroyed

    Possible fix:
    • a fix for this (SourceCodeLine: 91938): (red marked is new)
      Code:
      destroy: function() {
        var store = this.getStore();
        if (store && store.getAutoDestroy()) {
          store.destroy();
        }
        this.callParent(arguments);
      },

    Operating System:

    • Win 7

    Is there a better way to fix this?
    This dont work... dont know why
    :
    Code:
    Ext.override('Ext.dataview.DataView', {
      destroy: function() {
        alert('test');
      }
    });
    
    or:
    
    Ext.override('Ext.carousel.Carousel', {
      destroy: function() {
        alert('test');
      }
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Thanks for the report.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    This has been fixed for the next release (your fix is correct).

    The override syntax should be:

    Code:
    Ext.define('myOverride', {
        override: 'Ext.dataview.DataView',
        destroy: function() {
            alert('test');
        }
    });

    Sencha Inc

    Jamie Avins

    @jamieavins

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    -1
      0  

    Default

    Thank you verry much works perfect!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •