I am working with ExtJS 4.1 RC3 – following the MVC pattern. Today was the first time I’ve needed to implement some logic before any controllers get initialized. I remembered this method from Ext.app.Application and decided to put it to use.
It never seems to get fired, I can’t find what is supposed to be firing it either.
I found one small unanswered thread about this method not working from Sep 2011. The poster’s solution was to refactor his app. Does this work for everyone else or does no one else use this?
I am coding this the same way I would use the launch method. Is that wrong? Here is what the code looks like:
// app.js
Ext.application({
name: 'MyApp',
autoCreateViewport: true,
controllers: ['myController'],
init: function() {
console.log('init'); // this never gets called
},
launch: function() {
console.log('launch'); // this works fine
}
});
It’s a bug in the framework. I’ve pushed up a fix that will hopefully make it into the 4.1.1 release.