JQuery Easyui/TopJUI 基本树形表格的创建

html

<table data-toggle="topjui-treegrid"
       data-options="id:'menuTg',
        idField:'id',
        treeField:'text',
        url:remoteHost+'/system/codeItem/getListByCodeSetIdAndLevelId?codeSetId=0&levelId=0',
        expandUrl:remoteHost+'/system/codeItem/getListByPid?pid={id}'">
    <thead>
    <tr>
        <th data-options="field:'uuid',title:'UUID',checkbox:true"></th>
        <th data-options="field:'text',title:'名称'"></th>
        <th data-options="field:'codeSetId',title:'体系代码'"></th>
        <th data-options="field:'id',title:'编号'"></th>
        <th data-options="field:'pid',title:'父级编号'"></th>
    </tr>
    </thead>
</table>


<!-- 表格工具栏开始 -->
<div id="menuTg-toolbar" class="topjui-toolbar"
     data-options="grid:{
           type:'treegrid',
           id:'menuTg',
           parentIdField:'pid'
       }">
        <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'expandAll',
       extend: '#menuTg-toolbar',
       btnCls:'topjui-btn-blue'">展开全部</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'collapseAll',
       extend: '#menuTg-toolbar',
       btnCls:'topjui-btn-blue'">折叠全部</a>
</div>
<!-- 表格工具栏结束 -->

效果展示 

            页面默认展示

 

 点击展示全部效果

注意:这是一级一级的打开,点击一次打开一级 

点击折叠效果(一次性全部折叠。)

纯HTML代码,展示折叠方法都封装好了,可以直接调用。

 

 

   EasyUI中文网:http://www.jeasyui.cn

  TopJUI前端框架:http://www.topjui.com

  TopJUI交流社区:http://ask.topjui.com 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值