jQuery EasyUI 教程
jQuery EasyUI(也称为 EasyUI)是一个基于 jQuery 的前端 UI 框架,提供丰富的用户界面组件,如数据网格(datagrid)、树形菜单(tree)、布局(layout)、窗口(window)、表单验证等。它帮助开发者快速构建美观、交互性的网页应用,支持移动设备和跨浏览器。
虽然官方英文站点(https://www.jeasyui.com/)有详细的 Demo 和 Tutorial,但中文用户更推荐使用中文资源。以下是推荐的教程和文档:
推荐中文教程资源
- 菜鸟教程(Runoob) – jQuery EasyUI 教程
- 地址:https://www.runoob.com/jeasyui/jqueryeasyui-tutorial.html
- 内容全面,包括简介、CRUD 应用、数据网格、表单、拖拽、布局、菜单、窗口、树形菜单等。附带大量代码示例和离线下载。适合初学者一步步学习。
- W3Cschool – jQuery EasyUI 教程
- 地址:https://www.w3cschool.cn/jqueryeasyui/
- 详细章节,包含实例和项目框架讲解。强调实际开发流程,适合有一定基础的开发者。
- EasyUI 中文网(jeasyui.cn)
- 地址:https://www.jeasyui.cn/
- 官方中文站,提供组件演示、使用教程、开发文档、下载、扩展等。教程部分一步步演示如何创建应用,非常实用。
- 官方英文站点(jeasyui.com)
- 地址:https://www.jeasyui.com/tutorial/index.php
- 包含步步教程,如创建窗口、布局、CRUD DataGrid 等。Demo 丰富,如果英文没问题,可以直接参考。
快速入门:安装和基本使用
- 下载或 CDN 引入
从 https://www.jeasyui.com/download/ 下载包,或使用 CDN:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<!-- 这里写 EasyUI 组件 -->
</body>
</html>
- 基本示例:创建一个简单窗口(Window)
<div class="easyui-window" title="我的第一个窗口" style="width:400px;height:200px;padding:10px;">
Hello, jQuery EasyUI!
</div>
- 无需 JavaScript 代码,直接通过类和属性创建组件。
- 基本示例:数据网格(DataGrid)
<table class="easyui-datagrid" title="用户列表" style="width:700px;height:250px"
data-options="url:'data.json',singleSelect:true">
<thead>
<tr>
<th data-options="field:'name',width:100">姓名</th>
<th data-options="field:'age',width:100">年龄</th>
</tr>
</thead>
</table>
EasyUI 的优势在于标记式开发(少写 JS,多用 HTML 类),组件丰富,主题可换。如果你需要特定组件的教程(如 datagrid CRUD、treegrid、form 验证),或完整项目示例,请提供更多细节,我可以给出针对性代码!