Study on dynamic loading mechanism in ExtJS

Source: Internet
Author: User

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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.