PDA

View Full Version : Issue in using Ext.util.Observable



meena.chauhan
23 Jul 2012, 3:10 AM
Hi,

In one of my test application I am using Ext.util.Observable.


Code of PlanPM:

Ext.define('PlanPM', {

mixins: {
observable: 'Ext.util.Observable'
},

fields:[{name: 'label', type: 'String'}],
constructor : function(config)
{
this.mixins.observable.constructor.call(this, config);
this.addEvents('quit');

},

setLabel: function(label)
{
this._label = label;
this.fireEvent('quit');
},
getLabel: function()
{
return this._label;
}
});


My listener is inside the command class, but I am not bale to launch this listener function from my application.
The control doestn't come inside the listener.



Ext.define('Command', {
fields:[{name: 'cmdLabel', type: 'String'}],

listeners: {
quit: function() {
this.execute();
}
},

setCmdLabel: function(cmdLabel)
{
this._cmdLabel = cmdLabel;
},
getCmdLabel: function()
{
return this._cmdLabel;
},
execute: function()
{
alert("Command label "+this._cmdLabel);
}
});



Thanks,
Meena