Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
An example of creating an hierarchical extjs-5.0.x application.
If you have to create a big application in ExtJs, here you have an option
to develop an efficient application through modules, each as an application.
-- Application structure folder:
-app
--controller
--model
--store
--view
--module
...
--moduleX
--controller
--model
--store
--view
--ModuleX.js
...
--app.js
-- Application should extend from Ext.app.BundledApplication class and define his modules.
Ext.application({
name: 'Provider',
appFolder: 'app',
extend: 'Ext.app.BundledApplication', // here
views: [
'Master',
'Detail'
],
controllers: [
'Master'
],
stores: [
'People'
],
modules: ['Statistics'] //here
})
-- the module file ( Statistics.js ) in folder module should extend from Ext.app.BundledApplication ...
-- the module also is structured like MVC or MVVM pattern.
Ext.define('Provider.module.Statistics', {
extend: 'Ext.app.BundledApplication', //here
name:'Statistics',
controllers:['Descriptive', 'Inference'],
init: function () {
console.log('- Init Module: Statistics')
}
})
Notes:
If name property in the module is absent, then application name would be the last part of class name.
ex. ("application class name" = "Master.module.InnerMaster") --> ("application name" = "InnerMaster")
and should work with (InnerMaster) alias inside the module.
If name is provided, you should rename the app folder to that name.
ex. ("application name" = "MyName") --> ("application folder = "MyName")
This mechanism provides the modules at any level of depth. ex. (modules that contain others).
Enjoy it!