Relative paths using extjs 4

My directory structure is as follows. (I am using ext mvc)

  • www.mysite.com/ext/designer.js
  • www.mysite.com/ext/app/view
  • www.mysite.com/ext/app/store

I have js declared here

 <script type="text/javascript" src="http://extjs.cachefly.net/ext-4.0.2a/ext-all-debug.js"></script>
<script type="text/javascript" src="/ext/designer.js"></script>

My problem is that when it calls the repository, the path is wrong. "/ Jobs / edit /" is a page containing js

https://www.mysite.com/Jobs/edit/app/store/JobTypes.js?_dc=1326712425128

So how can I use extjs (in my existing web application) so that it uses the correct paths.

here is the designer js

Ext.Loader.setConfig({
    enabled: true
});




Ext.application({
    name: 'MyApp',

    stores: [
        'JobTypes',
        'SalesContact',
        'Job',
        'AccountHandlers'
    ],

    launch: function() {
        Ext.QuickTips.init();

        var cmp1 = Ext.create('MyApp.view.Jobs', {
            renderTo: Ext.getBody()
        });
        cmp1.show();
    }
});

I tried the following after configuration, but it does not seem to override the path.

Ext.Loader.setPath('MyApp', '/Ext/App');
+5
source share
1 answer

so that you can set the application folder like this.

appFolder: '/ ext / app',

Ext.application({
    name: 'MyApp',
    appFolder: '/ext/app',
    stores: [
        'JobTypes',
        'SalesContact',
        'Job',
        'AccountHandlers'
    ],

    launch: function() {
        Ext.QuickTips.init();
        Ext.Loader.setPath('MyApp', '/Ext/App');
        var cmp1 = Ext.create('MyApp.view.Jobs', {
            renderTo: Ext.getBody()
        });
        cmp1.show();
    }
});
+6

All Articles