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
    ChriZ is an unknown quantity at this point

      0  

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

    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)
      i´ll 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,215
    Vote Rating
    858
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      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
    ChriZ is an unknown quantity at this point

      0  

    Default


    Thank you verry much works perfect!

Thread Participants: 2