How to set custom folder names for views stores and models on ExtJs 4 application?

懵懂的女人 提交于 2019-12-25 14:11:29

问题


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

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