In function AAA
AAA = function(){
this.addEvents('event');
}
Ext.extend(AAA,Ext.util.Observable,{
....
this.fireEvent('event',parameter);
....
})
in function BBB
function BBB {
var aaa = new AAA();
aaa.on('event',function(parameter){
...}) Director General of Dubai Civil Defence to talk at fire event :: Director of the Dubai Civil Defence will be attending Liquid Plastics' Don't Get Your Fingers Burnt event to give an opening address. http://www.arabianbusiness.com/539005-director-general-of-dubai-civil-defence-to-talk-at-fire-eventHOME |
}
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
Post your actual code.
Your code is correct (although it would be better if you called the superclass constructor):
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');
Microsoft Unleashes Visual Studio .NET
IBM's iPhrase Buy Adds to WebSphere
|