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();
}
});
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();
}
});
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