EasyLoader function of jQuery EasyUI

Source: Internet
Author: User

EasyLoader can dynamically load scripts and CSS files, or dynamically load existing components of EasyUI.

You need to reference the EasyLoader. js file. Note: you do not need to reference the jquery. easyui. min. js file here.

For example, you can use the following two methods to load the linkbutton component:

The first method is implemented by setting the class:

<A href = "#" class = "easyui-linkbutton" onclick = "load1 ()"> load calendar </a>
As long as easyui-component name is set for the class, easyloader automatically loads the corresponding component dynamically.

The second method is implemented through scripts:

Using ('calendar ', function () {alert ("loaded successfully! ")});
Or

Easyloader. load ('calendar ', function () {alert ("loaded successfully! ")});
Here, using is equivalent to easyloader. load, that is, using is short for the easyloader. load Method.

Common attributes:

1) Locale: localization

Usage: easyloader. locale = "zh_CN"; // localized settings

2) Theme: Subject

Usage: easyloader. theme = "gray"; // sets the topic.

Event:

1) onProgress: triggered after each component is loaded

2) onLoad: triggered after the onProgress event. triggered when all components and associated components are loaded

The difference between the two can be seen from the name. onProgress events can be used to display the progress, while onLoad events can be used to prompt users to use components.

Sample Code: EasyUI.EasyLoader.rar

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.