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