4
votes

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?

1
What console message from the browser says ?Dejo
I get the initialized message from above, I don't get any other messages, no errors.Art F

1 Answers

3
votes

This is quite easy;

Ext.app.Controller does not have

  • appFolder
  • name
  • beforeLaunch

and 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.Application Controller. Also note that you can only have one active Ext.app.Application instance or you will mess up the EventBus (override the bus of the first Ext.app.Application). And even if you add these properties (appFolder, name) they do nothing at all cause the they are only used within the Ext.app.Application which is derived from Ext.app.Controller

The solution

Das.SubApp need to be Ext.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