Example of using requires in ExtJS4 _ extjs

Source: Internet
Author: User
The requires of ExtJS4 is a new mechanism mainly to implement asynchronous loading. The following articles will introduce the use of requires in ExtJS4, do not miss the requires of ExtJS4. It is a new mechanism, mainly to implement asynchronous loading. In this way, the corresponding js file will not be loaded without clicking the corresponding button or option, improving the loading speed and user waiting time.

The implementation of the requires mechanism uses an Ext. Loader. setConfig function to set the ing directory for file searching, and then uses Ext. require for loading when the corresponding js file is needed.

The file storage structure is as follows:

Uxfolder and lesson2.htm and lesson22.js are in the same directory, and MyWin. js used is stored in the ux folder.

The code in lesson2.html is as follows:

The Code is as follows:

Extjs4 desktop

Related Article

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.