jQuery easyui官方文档翻译web版:http://easydoc.cloudfoundry.com/doc/easyui/1.2.5/
Documentation
Each component of easyui has properties, methods and events. Users can extend them easily.
每个easyui组件都有特性(property)、方法(method)和事件(event),用户可以很容易地扩展它们。
属性 Properties
The properties is defined in jQuery.fn.{plugin}.defaults. For example, the dialog's properties is defined in jQuery.fn.dialog.defaults.
属性在jQuery.fn.{plugin}.defaults里定义。例如, dialog的特性在jQuery.fn.dialog.defaults里定义。
事件 Events
The events(callback functions) is defined in jQuery.fn.{plugin}.defaults also.
事件(回调函数)也在jQuery.fn.{plugin}.defaults里定义。
方法 Methods
The calling method syntax: $('selector').plugin('method', parameter);
Where:
- selector is the jquery object selector.
- plugin is the plugin name.
- method is the existing method corresponding to the plugin.
- parameter is the parameter object, can be a object, string, ...
调用方法的语法:$('selector').plugin('method', parameter);
其中:
- selector jquery对象选择器.
- plugin easyui组件名称.
- method 组件中的方法.
- parameter 参数, 可以是object, string, ...
The methods is defined in jQuery.fn.{plugin}.methods. Each method has two parameters: jq and param. The first parameter 'jq' is required, which refers to that jQuery object. The second parameter 'param' refers to the really parameter that pass through the method. For example, to extend a method named 'mymove' for the dialog component, the code looks like this:
方法在jQuery.fn.{plugin}.methods里定义。每个方法有两个参数:jq和param。第一个参数'jq'是必须的,它是指jQuery对象。第二个参数'param' 是指传递给方法的真正的参数。例如,给dialog组件扩展一个名叫'mymove' 的方法,代码看起来就像这样:
- $.extend($.fn.dialog.methods, {
- mymove: function(jq, newposition){
- return jq.each(function(){
- $(this).dialog('move', newposition);
- });
- }
- });
Now you can call 'mymove' method to move the dialog to specified position:
现在你可以调用'mymove'方法把dialog移动到一个指定的位置:
- $('#dd').dialog('mymove', {
- left: 200,
- top: 100
- });