1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    14
    Vote Rating
    0
    ankitjc.wipro is on a distinguished road

      0  

    Default Help with FireEvent

    Help with FireEvent


    Hi,

    I'm having some trouble in using the events in extJS.

    I have 2 files -

    A.js and B.js

    In A.js ->
    Code:
    functionStart: function() {
        this.B = new B ({
            listeners: {             
                     'functionToUse': this.onFunctionToUse,             
                     scope: this            
             }    
        });
    },
    
    onFunctionToUse: function(arg) {
         alert("Needs To Reach Here");
    }
    }

    In B.js ->

    Code:
    1) In constructor, I theres a button which invokes -> functionInvoker (); 
    
    2) //Custom defined events  
    this.addEvents({    'functionToUse': true  });
    
    3) //AND then in body -> 
    
     functionInvoker: function() {
        alert('Before');
        this.fireEvent('functionToUse',argument);    
        alert("After");  
    },


    My problem is the fireEvent is not working.
    I get the alerts "Before" and "After", but the onFunctionToUse is not getting called..

    Can someone please guide me a direction?

  2. #2
    Sencha Premium Member danguba's Avatar
    Join Date
    Feb 2009
    Location
    Kragujevac, Serbia
    Posts
    367
    Vote Rating
    5
    danguba is on a distinguished road

      0  

    Default


    My guess is that you are loosing scope. Try to console.log(this) in functionInvoker or post more code so I could provide better suggestion
    All Best
    ---
    Željko Mitrović
    http://skitanja.blogspot.com/

    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." Martin Golding

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