轻松学习jQuery插件EasyUI EasyUI创建树形网络(1)
作者:bea
一、EasyUI创建基础树形网格 树形网格(TreeGrid)组件从数据网格(DataGrid)继承,但是允许在行之间存在父/子节点关系。许多属性继承至数据网格(DataGrid),可以用在树形网格(TreeGrid)中。为了使用树形网格(TreeGrid),用户必须定义 'treeField' 属性,指明哪个字段作为树节点。 本文将向您展示如何使用树形网格(TreeGrid)组件设置一个文件夹浏览。 创建树形网格(TreeGrid) <table id="tes
一、EasyUI创建基础树形网格 树形网格(TreeGrid)组件从数据网格(DataGrid)继承,但是允许在行之间存在父/子节点关系。许多属性继承至数据网格(DataGrid),可以用在树形网格(TreeGrid)中。为了使用树形网格(TreeGrid),用户必须定义 'treeField' 属性,指明哪个字段作为树节点。 本文将向您展示如何使用树形网格(TreeGrid)组件设置一个文件夹浏览。
创建树形网格(TreeGrid)
<table id="test" title="Folder Browser" class="easyui-treegrid" style="width:400px;height:300px"
url="data/treegrid_data.json"
rownumbers="true"
idField="id" treeField="name">
<thead>
<tr>
<th field="name" width="160">Name</th>
<th field="size" width="60" align="right">Size</th>
<th field="date" width="100">Modified Date</th>
</tr>
</thead>
</table>
二、EasyUI创建复杂树形网格 树形网格(TreeGrid)可以展示有限空间上带有多列和复杂数据电子表格。本教程将演示如何将表格数据排列在分割的网格和多行表头中,以便组织共同的数据。
创建树形网格(TreeGrid)
<table title="Complex TreeGrid" class="easyui-treegrid" style="width:550px;height:250px"
url="data/treegrid2_data.json"
rownumbers="true" showFooter="true"
idField="id" treeField="region">
<thead frozen="true">
<tr>
<th field="region" width="150">Region</th>
</tr>
</thead>
<thead>
<tr>
<th colspan="4">2009</th>
<th colspan="4">2010</th>
</tr>
<tr>
<th field="f1" width="50" align="right">1st qrt.</th>
<th field="f2" width="50" align="right">2st qrt.</th>
<th field="f3" width="50" align="right">3st qrt.</th>
<th field="f4" width="50" align="right">4st qrt.</th>
<th field="f5" width="50" align="right">1st qrt.</th>
<th field="f6" width="50" align="right">2st qrt.</th>
<th field="f7" width="50" align="right">3st qrt.</th>
<th field="f8" width="50" align="right">4st qrt.</th>
</tr>
</thead>
</table>
正如您所看到的,树形网格(Treegrid)的使用和数据网格(Datagrid)一样。请使用 'frozen' 属性来定义冻结列,列的 'colspan' 和 'rowspan' 属性来定义多行表头。
以上就是分别为大家分享的EasyUI创建简单树形网络和复杂树形网络的方法,希望对大家的学习有所帮助。
想要学习更多内容请查看这篇文章: 《轻松学习jQuery插件EasyUI EasyUI实现树形网络基本操作(2)》
有用 | 无用
创建树形网格(TreeGrid)
<table id="test" title="Folder Browser" class="easyui-treegrid" style="width:400px;height:300px"
url="data/treegrid_data.json"
rownumbers="true"
idField="id" treeField="name">
<thead>
<tr>
<th field="name" width="160">Name</th>
<th field="size" width="60" align="right">Size</th>
<th field="date" width="100">Modified Date</th>
</tr>
</thead>
</table>
二、EasyUI创建复杂树形网格 树形网格(TreeGrid)可以展示有限空间上带有多列和复杂数据电子表格。本教程将演示如何将表格数据排列在分割的网格和多行表头中,以便组织共同的数据。
创建树形网格(TreeGrid)
<table title="Complex TreeGrid" class="easyui-treegrid" style="width:550px;height:250px"
url="data/treegrid2_data.json"
rownumbers="true" showFooter="true"
idField="id" treeField="region">
<thead frozen="true">
<tr>
<th field="region" width="150">Region</th>
</tr>
</thead>
<thead>
<tr>
<th colspan="4">2009</th>
<th colspan="4">2010</th>
</tr>
<tr>
<th field="f1" width="50" align="right">1st qrt.</th>
<th field="f2" width="50" align="right">2st qrt.</th>
<th field="f3" width="50" align="right">3st qrt.</th>
<th field="f4" width="50" align="right">4st qrt.</th>
<th field="f5" width="50" align="right">1st qrt.</th>
<th field="f6" width="50" align="right">2st qrt.</th>
<th field="f7" width="50" align="right">3st qrt.</th>
<th field="f8" width="50" align="right">4st qrt.</th>
</tr>
</thead>
</table>
正如您所看到的,树形网格(Treegrid)的使用和数据网格(Datagrid)一样。请使用 'frozen' 属性来定义冻结列,列的 'colspan' 和 'rowspan' 属性来定义多行表头。
以上就是分别为大家分享的EasyUI创建简单树形网络和复杂树形网络的方法,希望对大家的学习有所帮助。
想要学习更多内容请查看这篇文章: 《轻松学习jQuery插件EasyUI EasyUI实现树形网络基本操作(2)》
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- 易操作的jQuery表单提示插件
- JavaScript保留关键字汇总
- 轻松学习jQuery插件EasyUI EasyUI表单验证
- 整理Javascript函数学习笔记
- 全面解析Bootstrap弹窗的实现方法
- js获取及判断键盘按键的方法
- Eclipse引入jquery报错如何解决
- JS验证邮件地址格式方法小结
- 基于JavaScript操作DOM常用的API小结
- 详解JavaScript函数
- javascript定义类和类的实现实例详解
- 深入JavaScript高级程序设计之对象、数组(栈方法,队列方法,重排序方法,迭代方法)
- js跨域请求数据的3种常用的方法
- jQuery插件实现多级联动菜单效果
- 基于Jquery实现焦点图淡出淡入效果
- 轻松学习jQuery插件EasyUI EasyUI创建RSS Feed阅读器
- 轻松学习jQuery插件EasyUI EasyUI创建树形菜单
- 轻松学习jQuery插件EasyUI EasyUI实现树形网络基本操作(2)
- 基于javascript实现浏览器滚动条快到底部时自动加载数据