@ AuthorYHC all easyui components include attributes, methods, and events. You can simply extend them. attribute attributes are defined in jQuery. fn. {plugin }. in ults. for example, the attribute of the dialog box component [dialog] is defined in jQuery. fn. dialog. defaults. event (callback function...
@ Author YHC
All easyui components include attributes, methods, and events. You can simply extend them.
Attribute
The attribute is defined in jQuery. fn. {plugin}. defaults. For example, the attribute of the [dialog] component of the dialog box is defined in jQuery. fn. dialog. defaults.
Event
The event (callback function) is also defined in jQuery. fn. {plugin}. defaults.
Method
Call method Syntax: $ ('selector '). plugin ('method', parameter); I believe that everyone in $ ('selector ') Should Know About 'selector' as long as they have used jQuery. If you do not know it, we suggest you read jQuery first.
Where:
Selector is a jquery selector object.
Plugin is the plug-in name.
Method is the existing method corresponding to the plug-in.
Parameter is a parameter object. It can be an object, a string...
The method is defined in jQuery. fn. {plugin }. in methods, all methods have two parameters: jq and param. The first parameter 'jq' is required. This indicates the jQuery object, the second parameter 'param' refers to the real parameters of the input method. For example, to extend a method for the dialog component and name it 'mymove ', the code is like this:
$. Extend ($. fn. dialog. methods ,{
Mymove: function (jq, newposition ){
Return jq. each (function (){
$ (This). dialog ('move ', newposition );
});
}
});
Now you can call the 'mymove 'method to move the dialog box to the specified position .:
$ ('# Dd'). dialog ('mymove ',{
Left: 200,
Maximum: 100
});
JQuery EasyUI getting started
Download the js library and introduce the easyui CSS and Havascript files to your page.