I am currently trying to start an ExtJs MVC application that I created, integrated into another application. For unclear reasons it refuses to start, nor does it give any reasonable message as to why its happening, looking at the code below, I was able to determine that the init function runs to the end, but not the launch or beforeLaunch. Also Das.SubApp extends Ext.app.Controller.
this.subApp = Ext.create('Das.SubApp', {
appFolder: '/Scripts/app/das/FBrowser',
name: 'FBrowser',
controllers: ['BrowerController'],
dependencies: {
css: [],
js: []
},
init: function() {console.log("initialized")},
beforeLaunch: function() {
console.log("Before launch");
},
launch: function () {
console.log("launched library");
}
Here is code from the BrowserController:
Ext.define('FBrowser.controller.BrowserController',{
extend: 'Ext.app.Controller',
views: ['browser.tree_dir',...],
stores: [...],
requires: ['FBrowser.Utilities'],
init: function() {
this.control({..})
Anyone have any idea what could be wrong?
EDIT: Ok, so I seem to have found part of the issue, It appears that the application path isn’t being set, I still don’t understand why that is though, shouldn’t the appFolder point to the right place?
This is quite easy;
Ext.app.Controllerdoes not haveand if you initialize it this way it wan’t call the launch method cause this is all done or better said belongs to the
Ext.app.ApplicationController. Also note that you can only have one activeExt.app.Applicationinstance or you will mess up theEventBus(override the bus of the firstExt.app.Application). And even if you add these properties (appFolder, name) they do nothing at all cause the they are only used within theExt.app.Applicationwhich is derived fromExt.app.ControllerThe solution
Das.SubAppneed to beExt.app.Application(don’t extend if not really needed cause you can have only one instance active anyway).You may also be interested in this answer or this