code4jhon
code4jhon

Reputation: 6034

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

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

Upvotes: 0

Views: 555

Answers (1)

OhmzTech
OhmzTech

Reputation: 897

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

Upvotes: 3

Related Questions