jQuery EasyUI 官方API文档中文版


每个组件的属性,方法和事件。用户可以很容易地扩展他们。 

属性

所有的属性都定义在jQuery.fn.{plugin}.defaults里面。例如,对话框属性定义在jQuery.fn.dialog.defaults里面。

事件

所有的事件(函数)也都定义在jQuery.fn.{plugin}.defaults里面。

方法

调用方法的语法:$(‘selector').plugin(‘method', parameter);

解释:

  • selector jQery对象选择器。
  • plugin
    是插件的名称。
  • method
    是相应插件现有的方法。
  • parameter
    是参数对象,可以是一个对象、字符串等。

所有方法都定义在jQuery.fn.{plugin}.methods。每个方法都有2个参数:jqparam。第一个参数‘jq'是必须的,这是指的jQuery对象。第二个参数‘param'是指传入方法的实际参数。例如,为dialog组件扩展一个方法名为‘mymove',代码如下:
$.extend($.fn.dialog.methods, {   
    mymove: function(jq, newposition){   
        return jq.each(function(){   
            $(this).dialog(‘move', newposition);   
        });   
    }   
});  

$.extend($.fn.dialog.methods, {

mymove: function(jq, newposition){

return jq.each(function(){

$(this).dialog(‘move', newposition);

});

}

});

现在你可以调用‘mymove'方法将对话框移动到指定位置:
$(‘#dd').dialog(‘mymove', {   
    left: 200,   
    top: 100   
});  

$(‘#dd').dialog(‘mymove', {

left: 200,

top: 100

});

jQuery 入门指南

下载程序库并导入CSS文件到您的页面。
 rel=“stylesheet” type=“text/css” href=/themes/default/.css”>  
 rel=“stylesheet” type=“text/css” href=“easyui/themes/icon.css”>  
 type=“text/ src=“easyui/jquery-1.7.2.min.js”  
 type=“text/ src=“easyui/jquery.easyui.min.js” 

一旦你导入了EasyUI必须的文件,你就可以通过标记或定义一个EasyUI组件。例如:定义一个带可折叠功能的面板,你需要写的HTML代码如下:
 id=“p” class=“easyui-panel” style=“width:500px;height:200px;padding:10px;” title=“My Panel” iconCls=“icon-save” collapsible=“true”>  
       The panel content   
 

当通过标记创建一个组件的时候从1.3版开始‘data-options'属性可以用来支持HTML5兼容属性名称。所以你可以改写上面的代码为:
 id=“p” class=“easyui-panel” style=“width:500px;height:200px;padding:10px;”  title=“My Panel” data-options=“iconCls:'icon-save',collapsible:true”>  
    The panel content   
 

下面的代码演示了如何创建一个组合框,并绑定onSelect事件。
 class=“easyui-combobox” name=“language”  
        data-options=”   
            url:'combobox_data.json',   
            valueField:'id',   
            textField:'text',   
            panelHeight:'auto',   
            onSelect:function(record){   
                alert(record.text)   
            }” />  

声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 智乐兔
转载请注明:转自《jQuery EasyUI 官方API文档中文版
本文地址:https://www.zhiletu.com/archives-2623.html
关注公众号:智乐兔

赞赏

wechat pay微信赞赏alipay pay支付宝赞赏

上一篇
下一篇

相关文章

在线留言

你必须 登录后 才能留言!

在线客服
在线客服 X

售前: 点击这里给我发消息
售后: 点击这里给我发消息

智乐兔官微