PDA

View Full Version : catching fired events in the MVC controller, different than PR3 (and not working)



pkellner
1 Feb 2012, 6:31 PM
In PR3, I could capture fired events in the controllers init function as shown in the code below. Now, there seems to be no application.on any more. How can I capture application fired events in PR4?



Ext.define('Myapp.controller.Main', {
extend: 'Ext.app.Controller',
requires: [
'Myapp.store.SelectedRecipientsStore'
],


init: function () {
debugger;
console.log("init function in Myapp.controller.Main");
var me = this;




me.application.on({
emaildisplay: this.onEmailDisplay,
scope: this
});








},


config: {


refs: {
tabRecipients: 'tabsrecipients',
mainviewport: 'mainviewport',
selectedrecipientslist: 'selectedrecipientslist',
sectionslist: 'sectionslist'
},


control: {
"mainviewport": {
activate: "onActivatedPanelWith4TabsAndSelectedList"
},
"selectedrecipientslist": {
activate: "onActivatedSelectedRecipientsList"
},
"sectionslist": {
onItemDisclosure: "onItemDisclosureSectionsList"
},
"button[action=CompanyButton]": {
tap: "onTapCompanyButton"
},
"button[action=ADUsersButton]": {
tap: "onTapADUsersButton"
},
"button[action=ADGroupsButton]": {
tap: "onTapADGroupsButton"
}
},

mitchellsimoens
2 Feb 2012, 11:04 AM
Use me.getApplication() to get the application instance.