path of view is incorrect in extjs 4 mvc application

六月ゝ 毕业季﹏ 提交于 2019-12-22 14:13:41

问题


I'm trying to deploy my mvc app into my large web application. I have defined the app folder and can see in fire bug that it is calling the correct files with the exception of the initial view. So

"App.view.Jobs" is calling

https://www.estore.localhost/Jobs/Edit/ext/jobs/App/view/Jobs.js?_dc=1328471746967

when i would like it to call

https://www.estore.localhost/ext/jobs/App/view/Jobs.js?_dc=1328471746967

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

        name: 'MyApp',
        appFolder: '/ext/jobs/app',

        models: ['Part', 'Material', 'Job', 'Process'],
        stores: ['SalesContact', 'Parts', 'Materials', 'Jobs', 'AccountHandlers', 'JobTypes', 'Processs', 'Artwork', 'Varnish', 'VarnishType', 'PrintType', 'ProofRequired', 'InvoiceDetails', 'PurchaseOrders'],
        controllers: ['Part', 'Material', 'Job', 'Process', 'Invoice'],

        launch: function () {

            Ext.QuickTips.init();
            var cmp1 = Ext.create('App.view.Jobs', {
                renderTo: "form-job"
            });
            cmp1.show();
        }

    });

回答1:


to answer my own question. You can use setPath to assign the path.

like so...

Ext.Loader.setConfig({ enabled: true });
Ext.Loader.setPath('App', '/ext/jobs/app');
Ext.application({

    name: 'Pandora',
    appFolder: '/ext/jobs/app',

    models: ['Part', 'Material', 'Job', 'Process'],
    stores: ['SalesContact', 'Parts', 'Materials', 'Jobs', 'AccountHandlers', 'JobTypes', 'Processs', 'Artwork', 'Varnish', 'VarnishType', 'PrintType', 'ProofRequired', 'InvoiceDetails', 'PurchaseOrders'],
    controllers: ['Part', 'Material', 'Job', 'Process', 'Invoice'],

    launch: function () {

        Ext.QuickTips.init();
        var cmp1 = Ext.create('App.view.Jobs', {
            renderTo: "form-job"
        });
        cmp1.show();
    }

});



回答2:


This is easier if you use relative paths in appFolder as:

appFolder:'../../app'



来源:https://stackoverflow.com/questions/9152508/path-of-view-is-incorrect-in-extjs-4-mvc-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!