Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1173 in a recent build.
  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    60
    Vote Rating
    0
    stirucherai is on a distinguished road

      0  

    Default Destorying a button (itself) gives Uncaught TypeError: Cannot call method 'removeCls'

    Destorying a button (itself) gives Uncaught TypeError: Cannot call method 'removeCls'


    Hi,

    I have defined button (using ICONCLS) with-in a panel. As part of the handler (ontap), I preform some action and wanted to remove the button (that was tapped/pressed).

    I used panel.items.items[index for the button].destroy(), while the button is getting deleted/destroyed i get error

    52467 me.releasedTimeout = setTimeout(function() {
    52468 me.element.removeCls(me.getPressedCls());

    Basically me.element is null (as it has been removed)

    I tried used panel.remove(button item) the result is same.


    Is this a bug or there someother way of doing the same.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Vote Rating
    834
    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


    This is giving me no issues:

    Code:
    var btn = Ext.create('Ext.Button', {
        text : 'hi'
    });
    
    var cnt = Ext.Viewport.add({
        items : btn
    });
    
    setTimeout(function() {
        btn.destroy();
    }, 1000);
    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
    Join Date
    Aug 2011
    Posts
    60
    Vote Rating
    0
    stirucherai is on a distinguished road

      0  

    Default Try deleting the button on tap and check the console.log

    Try deleting the button on tap and check the console.log


    Hi,

    I tried deleting from javascript console and it works no issues. Issue is deleting the button when the button itself was pressed -- meaning on its own handler
    actionBar.add ({
    iconcls:'backButton'
    ,handler:function(b,e){
    <Some code>
    actionBar.remove(actionBar.items.items[0])
    }
    }

  4. #4
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Makes sense. It is because there is a timeout for the pressedCls, which is then going to try and remove it, from a button, which, no longer exists.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    60
    Vote Rating
    0
    stirucherai is on a distinguished road

      0  

    Default


    Thanks,

    But this problem was not in Sencha 1.1 -- I see this error only in Sencha 2.0

  6. #6
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Yeah, I've added it as a bug to ST 2.0. As you know, ST is just in it's preview stage, so there are a few little issues like this..
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  7. #7
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Are you sure you are on PR2? This seems to be already fixed.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi