1. #1
    Ext User everrich's Avatar
    Join Date
    Aug 2008
    Posts
    70
    Vote Rating
    0
    everrich is on a distinguished road

      0  

    Default About FireEvent

    About FireEvent


    In function AAA
    Code:
    AAA = function(){
    this.addEvents('event');
    }
    Ext.extend(AAA,Ext.util.Observable,{
    ....
     this.fireEvent('event',parameter);
    ....
    })
    in function BBB
    Code:
    function BBB {
    var aaa = new AAA();
    aaa.on('event',function(parameter){
    ...})
    }
    I have a problem with this code. Function AAA fireEvent , but Function BBB didn't catch and process event "event".
    I don't know why? I need your help. Thanks
    I'm sorry, my English is not so good.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,115
    Vote Rating
    507
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Post your actual code.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Your code is correct (although it would be better if you called the superclass constructor):
    Code:
    AAA = function(config){
    	this.addEvents('event');
    	AAA.superclass.constructor.call(this, config);
    }
    Ext.extend(AAA, Ext.util.Observable, {
    	test: function(parameter){
    		this.fireEvent('event', parameter);
    	}
    });
    var aaa = new AAA();
    aaa.on('event', function(parameter){
    	alert(parameter);
    });
    aaa.test('Hello');

Thread Participants: 2

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