webxells
29 Jun 2012, 11:59 AM
The problem:
Ext.application loads all controllers, automaticly, as long if the controller have no 'requires' or 'uses' property. Or a Ext.require is given before running the Ext.application code. As long the Ext.application runs without requires, all controller runs their 'init' functions. After given a 'require' it will never run this.
For example:
Ext.Loader.setConfig({
enabled:true,
paths:{
Editor:'app'
}
});
Ext.application({
name:'AppName',
appFolder:'app',
autoCreateViewport:false,
controllers:['MyController'],
launch:function () {
console.log('Launch App');
}
});
Runs the MyController init function. But if I do this:
Ext.Loader.setConfig({
enabled:true,
paths:{
Editor:'app'
}
});
Ext.require('Load.SomethingElse');
Ext.application({
name:'AppName',
appFolder:'app',
autoCreateViewport:false,
controllers:['MyController'],
launch:function () {
console.log('Launch App');
}
});
The controller is not running, even the launch function will not run. What is the problem, and how can I fix this? I don't understand why here is a mistake, should it not be possible to load any extra stuff manual - if I want to - and load everything else like expected automaticly? Thanks for help (PS: I studied the http://www.sencha.com/blog/using-ext-loader-for-your-application/ but it was not helpful in this manner).
Ext.application loads all controllers, automaticly, as long if the controller have no 'requires' or 'uses' property. Or a Ext.require is given before running the Ext.application code. As long the Ext.application runs without requires, all controller runs their 'init' functions. After given a 'require' it will never run this.
For example:
Ext.Loader.setConfig({
enabled:true,
paths:{
Editor:'app'
}
});
Ext.application({
name:'AppName',
appFolder:'app',
autoCreateViewport:false,
controllers:['MyController'],
launch:function () {
console.log('Launch App');
}
});
Runs the MyController init function. But if I do this:
Ext.Loader.setConfig({
enabled:true,
paths:{
Editor:'app'
}
});
Ext.require('Load.SomethingElse');
Ext.application({
name:'AppName',
appFolder:'app',
autoCreateViewport:false,
controllers:['MyController'],
launch:function () {
console.log('Launch App');
}
});
The controller is not running, even the launch function will not run. What is the problem, and how can I fix this? I don't understand why here is a mistake, should it not be possible to load any extra stuff manual - if I want to - and load everything else like expected automaticly? Thanks for help (PS: I studied the http://www.sencha.com/blog/using-ext-loader-for-your-application/ but it was not helpful in this manner).