I have the following code in my contoller
Code:
Ext.define('MyApp.controller.Installation', {
extend: 'Ext.app.Controller',
refs: [{
ref: 'installationsCombo',
selector: 'breadcrumb combobox'
}],
stores: ['Installations'],
models : ['AppState'],
init: function() {
// Start listening for events on views
this.control({
'breadcrumb combobox': {
select: this.onInstallationSelect,
scope: this
}
});
},
onLaunch: function() {
var installationsStore = this.getInstallationsStore();
installationsStore.load({
callback: this.onInstallationsLoad,
scope: this
});
},
onInstallationsLoad: function() {
var installationsCombo = this.getInstallationsCombo();
installationsCombo.select(1);
//installationsCombo.fireEvent("select", this.getInstallationsStore().getAt(0));;
},
onInstallationSelect: function(selModel, selection) {
console.log("Installation selection changed");
this.getAppStateModel().selectedInstallationId = selection[0].get('installationId');
this.getAppStateModel().selectedInstallationName = selection[0].get('name');
// Fire an application wide event
this.application.fireEvent('installationSelect', selection[0]);
console.log("Installation Select Event fired");
},
The problem I am facing is that the " installationsCombo.select(1); " is not firing the select event and hence the onInstallationSelect method is not being called. I use this event to load other parts of the application. When I make a selection from the combobox manually, everything works.
Any ideas as to why the select() method on the combo box is not firing the select event?
Thanks in advance.