combotree下拉树

合同类别:

var t;
$("#contractType").combotree({
url:“jsczxc/bibsccentercjgl/BibscCenterCjglController/operation/barContractDaftGettree/3/ContractTypeHigh”,
valueField : ‘id’,
multiple:true,
onlyLeafCheck : true,
onShowPanel : function(){
t = $("#contractType").combotree(“tree”);
var n = t.tree(‘getSelected’); // 获取选择的节点
alert(n.text);
t.tree(‘expandAll’);
var panelWidth = $(this).combotree(‘textbox’).parent().outerWidth(true);
$(this).combotree(‘panel’).panel(‘resize’,{width: panelWidth});
},
onHidePanel:function(){
KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲contractTypeNam…("#contractType").combotree(‘getText’));
}
});

/**
* 只查询合同的类型
* @param level
* @param id
* @return
*/
@RequestMapping(value="/operation/barContractDaftGettree/{level}/{parentCode}")
@ResponseBody
public List getBarContractDaftByParentId(@PathVariable(value=“level”)int level,
@PathVariable(value=“parentCode”)String parentCode,@RequestParam(required=false) String id){
//SysListDictionaryDTO nodeByParentCodeNew = this.service.getNodeByParentCodeNew(parentCode);
if(id == null){
id = “-1”;
}else{
level=1;
}
return service.getSysListDictionaryByParentCode(id,level);
}

//按照父id查询数据
public List getSysListDictionaryByParentCode(String parentId,int level){
List tree = new ArrayList();
if (level == 0) {
return null;
}
level–;

	String parenIdSql = "select (select count(1) from BIBSC_CENTER_CONTRACT_TYPE t1 where t.ID = t1.PARENT_ID) childCount,\n" +
					"  t.name,\n" + 
					"  t.PARENT_ID,\n" + 
					"  t.ID\n" + 
					"  from BIBSC_CENTER_CONTRACT_TYPE t  where t.PARENT_ID = '"+ parentId +"'";

	
	List<Map<String, Object>> subTrees = dao.getSysListDictionaryByParentCode(parenIdSql);
	
	for (Map<String, Object> map : subTrees) {
		TreeNode node = new TreeNode();
		node.set_parentId(map.get("PARENT_ID").toString());
		String id = map.get("ID").toString();
		node.setId(id);
		node.setText(map.get("NAME").toString());
		HashMap<String, Object> attr = new HashMap<String, Object>(1);
		Integer count = Integer.valueOf(map.get("CHILDCOUNT").toString());
		attr.put("count",count);
		node.setAttributes(attr);
		
		if (count > 0) {
			if (level > 0) {
				node.setState("open");
			} else {
				node.setState("closed");
			}
			node.setChildren(this.getSysListDictionaryByParentCode(id,level));
		} else {
			node.setState("open");
		}
		tree.add(node);
	}
	return tree;
}

public List<Map<String,Object>> getSysListDictionaryByParentCode(String idz);

${value}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值