mercredi 28 mai 2014

ViewControllers and beforeInit

After reading about ViewControllers in the Sencha Blog post about them, I tried using the beforeInit function to initialise some variables, but found that the function was never called. Has anyone else tried this? Is this functionality broken, or have I done something wrong?

Here's the code I'm using (fairly straight-forward):



Code:



Ext.define('MyApp.view.MainController', {
extend: 'Ext.app.ViewController',
alias: 'controller.main',

beforeInit: function () {
console.log('beforeInit - loading css files');
},
init: function () {
console.log('init - doing stuff here now');
}
});

In the application's launch function, I create the main view which uses the above controller. I see the console entry for the init function, but nothing for beforeInit. Thoughts?


Aucun commentaire:

Enregistrer un commentaire