jqueryeasyui 귀속 실현 사용자 그룹 트리

1435 단어
/**
*  _ 
* @param 
* @return
*/
public List<TreeNode> getUserAllGroupTree(){
List<TreeNode> treeNodeList=new ArrayList<TreeNode>();
TreeNode rootNode=new TreeNode("root"," ");
List<TreeNode> groupNodeList=new ArrayList<TreeNode>();
List<KeyValueObject> userGroupList = getUserGroupData();// 
for(KeyValueObject userRoleGroup : userGroupList){
TreeNode groupNode = new TreeNode("Group_"+userRoleGroup.getKey(),userRoleGroup.getValue());
groupNode.setIconCls("icon-line");
groupNodeList.add(groupNode);
recursionUserGroup(groupNode,userRoleGroup);
}
rootNode.setChildren(groupNodeList);
treeNodeList.add(rootNode);
return treeNodeList;
}
/*
*  
*/
public void recursionUserGroup(TreeNode childGroupNode,KeyValueObject userChildGroup){
List<TreeNode> userChildList1 = new ArrayList<TreeNode>();
List<KeyValueObject> userChildGroupList1 = getUserChildGroupData(userChildGroup.getKey());
if(userChildGroupList1.size()>0){
for(KeyValueObject userChildGroup1 : userChildGroupList1){
TreeNode childGroupNode1 = new TreeNode("Group_"+userChildGroup1.getKey(),userChildGroup1.getValue());
childGroupNode1.setIconCls("icon-line");
userChildList1.add(childGroupNode1);
recursionUserGroup(childGroupNode1,userChildGroup1);
}
}
if(userChildList1.size()>0){
childGroupNode.setChildren(userChildList1);
}
}

좋은 웹페이지 즐겨찾기