JQueryEasyUI学习简单Demo

一.Layout布局

声明:此文档参考了jQuery EasyUI官方文档

布局容器有5个区域:北、南、东、西和中间。中间区域面板是必须的,边缘的面板都是可选的。每个边缘区域面板都可以通过拖拽其边框改变大小,也可以点击折叠按钮将面板折叠起来。布局可以进行嵌套,用户可以通过组合布局构建复杂的布局结构。

1.通过以下代码可以构建下图的效果:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlkAAAEsCAIAAAB/nTH/AAAgAElEQVR4Ae2dCXhUVZr361bCHjCiSIJ7syiIsjk9HRWiYi8k9tfTyqLMjIqAgguo2AtD01/P54Kj2C3goNKtuExrE7C3D4Izj6gEND06CQq2UXbtbgIaUdkFUjXvrVN1c29tqbK2u/zuU8/l3HPfc877/t6q8+fce6uiHT16dOnavRMv6e1jgwAEIAABCHiPwPPr9/i9FzURQwACEIAABCwEitVRMGip5QACEIAABCDgHQJhLWz1IYbeSTqRQgACEICAhYCxLkQLLVw4gAAEIAABZxFY1fBpcoerR5yUyMDQQi2RBfUQgAAEIAABmxOobWz5xrk9kzspYlk1/OS4NhEtDMQ9SyUEIAABCEDA7gRqN7RUDOx5WmlRckdFLFc1tFQNiyOHYS0McL8wOULOQgACEICAXQnITT55HbI+BTrvkVdm33G52WVlFlfvIuvCINdIzcQoQwACEICAcwgEfaKDra1tQvbgojXivcjhD28fbYSha6Vu2WZmnDK0UEzatvOv+rkczJs55sw+pRN/9II6sem3d7VZpF+a/Ujtyrr3rxx17rw7qpK0Xrm2afaC1WYDcePKyoFSs3hZ/WPL6tvtYexdz32w8xOxnz6h4pYJFeauKEMAAhCAgFsJtAbCQvbwo69IjLNuu1wKDy5cIwVzyEHr8lGdCn/XPhjQzK9fPzBRTj/9h/8Z3LfPvBljpCw1ZoNUyj/+xWrRVMPy/hnV0o8IslETt7C+cec5Z/WaPl7XMDX0R82fK8vp4y7auGKW9GNuGDWKnFo+/zrVUNd/a1wcQgACEICACwmEFnzHWzV5zV/0iojdzOmjpSx7KUuNO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1a2EIAAhCAgBsJoIVuzCoxQQACEIBAOgTQwnRoYQsBCEAAAm4kgBa6MavEBAEIQAAC6RBAC9OhhS0EIAABCLiRAFroxqwSEwQgAAEIpEMALUyHFrYQgAAEIOBGAmihG7NKTBCAAAQgkA4BtDAdWthCAAIQgIAbCaCFbswqMUEAAhCAQDoE0MJ0aGELAQhAAAJuJIAWujGrxAQBCEAAAukQCP/9wiUv70mnFbYQgAAEIAAB9xDQjh492qFDB/cERCQQgAAEIACBNAn8LwDprF6Qg7l+AAAAAElFTkSuQmCC" alt="" width="419" height="209" />
<body class="easyui-layout">
<div data-options="region:'north',title:'North Title',split:true" style="height:100px;"></div>
<div data-options="region:'south',title:'South Title',split:true" style="height:100px;"></div>
<div data-options="region:'east',iconCls:'icon-reload',title:'East',split:true" style="width:100px;"></div>
<div data-options="region:'west',title:'West',split:true" style="width:100px;"></div>
<div data-options="region:'center',title:'center title'" style="padding:5px;background:#eee;"></div>
</body>

2.折叠布局面板

 //获得id=‘cc’的布局面板
$('#cc').layout();
// collapse the west panel
//coolapse表示折叠布局方法,west表示那个方向的面板
$('#cc').layout('collapse','west');

3.布局属性

fit属性:如果设置为true,布局组件将自适应父容器。当使用'body'标签创建布局的时候,整个页面会自动最大。默认false

4.区域面板属性

JQueryEasyUI学习简单Demo

5.用tree的形式布局west区域的菜单

JQueryEasyUI学习简单Demo

代码如下:

 <ul id="tt" class="easyui-tree">
<li>
<span>Folder</span>
<ul>
<li>
<span>部门管理</span>
<ul>
<li>
<span><a href="#" onclick="doclickMenu('deplist.jsp','部门列表')">部门列表</a></span>
</li>
<li>
<span><a href="#" onclick="doclickMenu('depadd.jsp','部门添加')">部门添加</a></span>
</li>
<li>
<span><a href="#">部门审核</a></span>
</li>
<li>
<span><a href="#">部门统计</a></span>
</li>
</ul>
</li>
<li>
<span>员工管理</span>
<ul>
<li>
<span><a href="#">员工列表</a></span>
</li>
<li>
<span><a href="#">员工添加</a></span>
</li>
<li>
<span><a href="#">今日打卡</a></span>
</li>
<li>
<span><a href="#">个人统计</a></span>
</li>
</ul>
</li>
<li>
<span>邮箱管理</span>
<ul>
<li>
<span><a href="#">邮件列表</a></span>
</li>
<li>
<span><a href="#">编写邮件</a></span>
</li>
<li>
<span><a href="#">接收邮件</a></span>
</li>
<li>
<span><a href="#">垃圾箱</a></span>
</li>
</ul>
</li>
<li>
<span>请假管理</span>
<ul>
<li>
<span><a href="#">请假列表</a></span>
</li>
<li>
<span><a href="#">请假申请</a></span>
</li>
<li>
<span><a href="#">请假审核</a></span>
</li>
<li>
<span><a href="#">请假统计</a></span>
</li>
</ul>
</li>
</ul>
</li>
<li>
<span>File21</span>
</li>
</ul>

6.选项卡如下图:

JQueryEasyUI学习简单Demo

代码如下:

 /********点击west区域的菜单栏,在center区域添加新标签******/
function doclickMenu(surl, title) {
//判断选项卡是否选中
if($('#tt1').tabs('exists',title)) {
$('#tt1').tabs('select',title);//选中title这个选项卡
} else { $('#tt1').tabs('add',{
title:title,
content:'<iframe id="myfrm" src="'+surl+'" frameborder="0" height="100%" width="100%" scrolling="no" marginheight="0" marginwidth="0"></iframe>', });
}
} <li>
----------------------------------------------------------------------------------
<span><a href="#" onclick="doclickMenu('deplist.jsp','部门列表')">部门列表 </a></span>
</li> ---------------------------------------------------------------------------------
<div id="tt1" class="easyui-tabs" fit='true' style="width:500px;height:250px;"> </div>

7.datagrid(数据表格树)

如下图:

JQueryEasyUI学习简单Demo

代码:

 <link rel="stylesheet" href="easyui/themes/default/easyui.css"
type="text/css"></link>
<link rel="stylesheet" href="easyui/themes/icon.css" type="text/css"></link>
<script type="text/javascript" src="easyui/jquery-1.9.1.js"></script>
<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
<script>
$(function() { var data = [
{'sid':'1','uname':'张飞','sex':'男','address':'西安','birthday':'1990-01-01'},
{'sid':'2','uname':'关羽','sex':'男','address':'西安','birthday':'1990-01-01'},
{'sid':'3','uname':'魏延','sex':'男','address':'西安','birthday':'1990-01-01'},
{'sid':'4','uname':'赵云','sex':'男','address':'西安','birthday':'1990-01-01'},
{'sid':'5','uname':'黄忠','sex':'男','address':'西安','birthday':'1990-01-01'}
]; $("#tt").datagrid({
data:data, //设置json格式数据
width:'fit', //设置面板宽度为父容器的宽度
singleSelect:true, //这允许选中一行
pagination:true,//如果为true,则在DataGrid控件底部显示分页工具栏
pageList:[5,10,15,20],//在设置分页属性的时候 初始化页面大小选择列表
pageSize:5,//在设置分页属性的时候初始化页面大小
loadMsg:'正在加载数据...',
columns:[[
{field:'sid',title:'编号',width:100,checkbox:true},
{field:'uname',title:'姓名',width:100},
{field:'sex',title:'性别',width:100,align:'right'},
{field:'address',title:'地址',width:100,align:'right'},
{field:'birthday',title:'生日',width:100,align:'right'},
{field:'option',title:'操作',width:100,align:'right',
formatter:function(value,row,index){
return '<input type="button" name="button" id="button" value="删除" onclick="doDel('+ row.sid +')"/><input type="button" name="button" id="button" value="更新" />';
}} ]]
}); });
//删除
function doDel(sid) {
alert(sid);
}
</script>
</head> <body>
部门列表
<table id="tt"> </table> </body>

说明:formatter是datagrid的列属性,用法:

 $('#dg').datagrid({
columns:[[
{field:'userId',title:'User', width:80,
formatter: function(value,row,index){
if (row.user){
return row.user.name;
} else {
return value;
}
}
}
]]
});
 
上一篇:WPF案例 (四) 模拟Windows7桌面任务栏


下一篇:操作系统史/多道/进程