Yesterday our team did some in-depth research on the dynamic loading mechanism of EXTJS, which share the results of controller loading first.
Take service registry Portlets for example:
For example, in Liferay-portlet.xml, you define:
So our JS entry point is App.js, which creates the ext.application and declares the dynamic load controller:
Ext.application ({
name: ' Serviceregistry ',
appfolder: '/serviceregistryportlet/js/app ',
controllers: [' Mainpanel '],
launch:function () {
...
)
Here we look at how the ExtJS is dynamically loaded controller.
First we can see that when it loads controller, all controller declared here are passed to the Classnames property as the full name of the class
The ext.loader config option paths receive 2 properties, one is the default ext path, and its default value is defined as follows:
Config: {
Enabled:false, Disablecach
Ing:true, Disablecachingparam: ' _dc ', Paths: {
' Ext ': '. ' }
},
The other is the property obtained from the Ext.application, whose key is the name defined in Ext.application (here is Serviceregistry),
Value is the Appfolder defined in Ext.application (here is/serviceregistryportlet/js/app)
As shown in the following illustration:
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/Extjs/