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
    364
    Vote Rating
    3
    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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar