课程表

jEasyUI 应用

jEasyUI 拖放

jEasyUI 菜单与按钮

jEasyUI 布局

jEasyUI 数据网格

jEasyUI 窗口

jEasyUI 树形菜单

jEasyUI 表单

jEasyUI 参考手册

工具箱
速查手册

jEasyUI 创建列组合

当前位置:免费教程 » JS/JS库/框架 » jQuery EasyUI

easyui 的数据网格(DataGrid)可以创建列组合,如下所示:

在本实例中,我们使用平面数据来填充数据网格(DataGrid)的数据,并把 listprice、unitcost、addr1、status 列组合在一个单一的列下。

为了创建列组合,您应该定义数据网格(datagrid)插件的 columns 数据。列的每个元素是定义一组可使用 rowspan 或 colspan 属性来进行组合的单元格。

下面的代码实现了上面的实例:

  1. <table id="tt" title="Column Group" class="easyui-datagrid" style="width:550px;height:250px"
  2. url="data/datagrid_data.json"
  3. singleSelect="true" iconCls="icon-save" rownumbers="true">
  4. <thead>
  5. <tr>
  6. <th rowspan="2" field="itemid" width="80">Item ID</th>
  7. <th rowspan="2" field="productid" width="80">Product ID</th>
  8. <th colspan="4">Item Details</th>
  9. </tr>
  10. <tr>
  11. <th field="listprice" width="80" align="right">List Price</th>
  12. <th field="unitcost" width="80" align="right">Unit Cost</th>
  13. <th field="attr1" width="100">Attribute</th>
  14. <th field="status" width="60" align="center">Stauts</th>
  15. </tr>
  16. </thead>
  17. </table>

下载 jQuery EasyUI 实例

jeasyui-datagrid-datagrid9.zip

转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号