问题
I ask this because there is an existing application that I would like to enable for using Sencha CMD so first step is to instantiate it via:
Ext.Application
which presents the first problem:
folder structure is
someApp
--Views
--Model
--Store
--moreFolders
(should be model, store, view)
Rather than refactoring hundreds of classes(huge app) I want to set the folders path if possible.
Can you think in any drawbacks? What would your approach be?
Any ideas are very well received.
Using ExtJs 4.1.1
回答1:
Use Ext.Loader.paths.
You can actually set these against your Ext.application when initializing, for example:
Ext.application({
name: 'MyApp',
paths: {
'MyCustom': 'wherever/custom',
},
launch: function() {
Ext.create('MyCustom.view.List'); // Goes to wherever/custom/view/List.js
}
});
来源:https://stackoverflow.com/questions/29439463/how-to-set-custom-folder-names-for-views-stores-and-models-on-extjs-4-applicatio