Introduction to the Easyloader features of JQuery Easyui _jquery

Source: Internet
Author: User
Tags locale

Easyloader can dynamically load scripts and CSS files, or dynamically load Easyui existing components

Need to refer to Easyloader.js file, note: There is no need to refer to the Jquery.easyui.min.js file.

For example, if you need to load the LinkButton component, you can load it in the following two ways:

The first way to do this is by setting class:


<a href= "#" class= "Easyui-linkbutton" onclick= "Load1 ()" > Load calendar </a>
Easyloader automatically loads the appropriate component as long as the class sets the easyui-component name

The second is implemented by scripting:

using (' Calendar ', function () {alert ("loaded successfully!") ") });
Or

Easyloader.load (' Calendar ', function () {alert ("loaded successfully!") ") });
The using is equivalent to Easyloader.load, that is, the using is shorthand for the Easyloader.load method.

Common Properties:


1) Locale: localization

Usage: Easyloader.locale = "ZH_CN"; Localization settings

2) Theme: Theme

Usage: Easyloader.theme = "Gray"; Set a Theme


Event:

1) OnProgress: Triggers after each component is completed loading

2 OnLoad: Triggered after the OnProgress event, when the component and the associated component are all loaded complete

The difference between the two can be discerned from the name, and the OnProgress event can be used to show progress, and the OnLoad event can be used to prompt the user to use the component.

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.