Hi all,
I want to declare some variables which should be accessible through-out the controller. Right now I am using 'statics' section to declare such variable. Please let me know if there is a better or easier way to declare such variables?
Code:
Ext.define('MyController',
{
extend: 'Ext.app.Controller',
statics: {
variableOne: '',
variableTwo: ''
},
init: function () {
this.control({
'myView #my-grid': {
select: this.onSelect
},
''myView #myRadio': {
change: this.onRadioChange
}
});
},
onSelect: function (grid, record, index, eOpts) {
this.self.variableOne = 10;
},
onRadioChange: function (rdBtn, newValue, oldValue, eOpts) {
//Accessing go
var val = this.self.variableOne;
}
});