1个回答
展开全部
$('#departmentName').combotree({
url:'/pc/department/departmentTree/0.htm',
editable:false,
required:true,
onSelect : function(node){
}
});
其中 URL 返回的数据源 包含tree j结构
public List<Map<String, Object>> getChildDeptComp(List<Map<String, Object>> list,String companyId){
for(Map<String,Object> map : list){
String haveChildDept = map.get("haveChildDept").toString();
map.put("iconCls", "department");
if("Y".equals(haveChildDept)){//存在子部门
String deptId = map.get("id").toString();
List<Map<String, Object>> childList = this.departmentDao.departmentTree(deptId,companyId);
getChildDeptComp(childList,companyId);
map.put("state", "closed");
map.put("children", childList);
}else{
map.put("state", "open");
}
}
return list;
}
url:'/pc/department/departmentTree/0.htm',
editable:false,
required:true,
onSelect : function(node){
}
});
其中 URL 返回的数据源 包含tree j结构
public List<Map<String, Object>> getChildDeptComp(List<Map<String, Object>> list,String companyId){
for(Map<String,Object> map : list){
String haveChildDept = map.get("haveChildDept").toString();
map.put("iconCls", "department");
if("Y".equals(haveChildDept)){//存在子部门
String deptId = map.get("id").toString();
List<Map<String, Object>> childList = this.departmentDao.departmentTree(deptId,companyId);
getChildDeptComp(childList,companyId);
map.put("state", "closed");
map.put("children", childList);
}else{
map.put("state", "open");
}
}
return list;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询