Alex
Alex

Reputation: 5724

Using Ext.loader with Ext.application

How does one enable the loader when using ext.application?

Ext.application({
    name: 'App',
    launch: function () {
        Ext.Loader.setConfig({enabled:true});
        Ext.Loader.setPath('App','js/App');
        Ext.create('App.view.SomeView');//this blows up in my face
    }
});

This is what I'm currently doing, and its trying to open:

./App/view/SomeView 

instead of

./js/App/view/SomeView

Upvotes: 2

Views: 3545

Answers (1)

Vytautas
Vytautas

Reputation: 3539

you can add appFolder like this:

Ext.Loader.setConfig({enabled:true});
Ext.application({
    name: 'App',
    appFolder: 'js/App', // maybe '/js/App'

    launch: function () {
        Ext.create('App.view.SomeView');
    }
});

Maybe your code would work too, but you have to move your loader config out of launch() method because it fires after application is created and I guess that causes your problem.

Upvotes: 3

Related Questions