easyui tree

原创
2018/12/14 15:49
阅读数 109

<tr>
     <th><spring:message code="wf.borrow.examiner"/></th>
     <td>
     <input id="inp-examiner1" type="text" name="examiner1" style="width:197px;height:20px;" data-options="required:true"/>
    </td>
 </tr>

 

$("#inp-examiner1").combotree({
            url : '${ctx}/employ/deptEmployeeTreeSpare?orgno=${sessionInfo.orgno}',  
            parentField : 'pid', 
            lines : true,
            checkbox: true ,
            panelHeight : 'auto' ,
            /* 关闭所有子节点 */
            onLoadSuccess: function (row, data) {
              $("#inp-examiner1").combotree('tree').tree("collapseAll");
            },
            /* 父节点不可选中 */
            onBeforeSelect: function(node) {
            if (!$(this).tree('isLeaf', node.target)) {
                return false;
              }
            },
            /* 点击父节点不关闭弹出框*/
            onClick: function(node) {
              if (!$(this).tree('isLeaf', node.target)) {
                $("#inp-examiner1").combo('showPanel');
            
            }
            
        }
            
    });

 

创建实体类

id为节点id 也是返回的id

pid记录父节点id

text 显示文本

public class Tree implements java.io.Serializable {

    private String id;
    private String text;
    private String state = "open";// open,closed
    private boolean checked = false;
    private Object attributes;
    private List<Tree> children;
    private String iconCls;
    private String pid;
 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部