lingting1995 2016-11-14 08:22 采纳率: 47.4%
浏览 2544

easyui treeGrid 加载时折叠子节点

 <table id="unit_list_grid" class="easyui-treegrid"
            data-options="              
                rownumbers:true,
                url:'${pageContext.request.contextPath }/sysUnit/showList.do',
                idField : 'id',
                treeField : 'name',
                fit:true,   
                parentField : 'parentId',
                fitColumns : true,
                animate:true,
                state:'closed',
                onClickRow:function(row) {UnitList.onClikNode(row)},
                onLoadSuccess:function(row, data){UnitList.onLoadSuccess(row, data)},
                onContextMenu: function(e,node){UnitList.showRight(e,node);}">
            <thead>
                <tr>
                    <th data-options="field:'id',hidden:true"></th>
                    <th data-options="field:'name',width:180">单位名称</th>
                    <th data-options="field:'coding',width:100">单位编号</th>
                    <th data-options="field:'type',width:180">单位类型</th>
                    <th data-options="field:'status',width:80,
                        formatter: function(value,row,index){if (row.status==1){return '启用';} else {return '停用';}}">状态</th>
                </tr>
            </thead>
        </table>

        这是表格,默认值显示第一级和第二级节点数据怎么实现?,网上查了一下,还是没搞明白
  • 写回答

1条回答 默认 最新

  • Go 旅城通票 2016-11-14 09:23
    关注

    看tree的state配置,默认为open,大于3级的数据节点增加state:'close'

     Tree Data Format
    
    Every node can contains following properties:
    
        id: node id, which is important to load remote data
        text: node text to show
        state: node state, 'open' or 'closed', default is 'open'. When set to 'closed', the node have children nodes and will load them from remote site
        checked: Indicate whether the node is checked selected.
        attributes: custom attributes can be added to a node
        children: an array nodes defines some children nodes
    
    
    评论

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料