1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    3
    Vote Rating
    0
    _Scorpion_ is on a distinguished road

      0  

    Default Answered: Is getCmp the only way to get parent element from listener?

    Answered: Is getCmp the only way to get parent element from listener?


    Hi! In my project I've found some strange thing and I'm not sure if it's ok or not.
    I define class which extends 'Ext.tree.Panel' and have id='themesGrid'.
    I have several listeners defined like:

    Code:
    Ext.define('mypackage.MyTree', {
        extend: 'Ext.tree.Panel',
        id: 'themesGrid',
        ...
        initComponent: function () {
             Ext.apply(this, {
             ...
                    viewConfig: {
                        listeners: { //<- Here are listeners - "beforedrop", etc.
             ...
    And in these listeners I get parent TreePanel only using Ext.getCmp('themesGrid'), which looks "not right" for me. Can someone enlighten me and tell me if I'm wrong here?

  2. In your initComponent, create a reference var like

    Code:
    var me = this;
    Then inside listeners, use that ref ... for eg., me.yourFunction

  3. #2
    Sencha User
    Join Date
    Oct 2010
    Posts
    39
    Answers
    6
    Vote Rating
    5
    Piruthu is on a distinguished road

      1  

    Default


    In your initComponent, create a reference var like

    Code:
    var me = this;
    Then inside listeners, use that ref ... for eg., me.yourFunction

  4. #3
    Sencha User
    Join Date
    May 2013
    Posts
    3
    Vote Rating
    0
    _Scorpion_ is on a distinguished road

      0  

    Default


    Works great, thanks! I felt that something was wrong there...

Thread Participants: 1

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