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