–导入所需要的包
–ztree/zTreeStyle/css/bootstrapStyle/bootstrapStyle.css
–ztree/js/*
–创建div
<div class="table-over-content">
<div class="table-over-content-child">
<ul id="logTree" class="ztree"></ul>
</div>
</div>
var query_cascade_id_=cascade_id_;
$.get(‘org/getOrgTree’,{orgBusinessKey:""},function(data){
.
f
n
.
z
T
r
e
e
.
i
n
i
t
(
.fn.zTree.init(
.fn.zTree.init(("#logTree"),ajaxtreesetting,data);//初始化树节点信息
var zTree=$.fn.zTree.getZTreeObj(“logTree”);
var node = zTree.getNodes();//获得该树
//alert(cascade_id_);
zTree.expandNode(node[0]); //展开顶级节点
if(query_cascade_id_==‘null’){
query_cascade_id_=node[0].cascade_id_ ;
}
});
//ztree树信息配置
var ajaxtreesetting = {
async: {
enable: true,
url:“org/getOrgSubNode”,
type:“get”,
autoParam:[“businessKey”,“orgBusinessKey”]
},
callback: {
onClick: zTreeOnClick
},
/* check:{
autoCheckTrigger:false,
chkboxType:{“Y”:"",“N”:""},
chkStyle:“checkbox”,
enable: true,
nocheckInherit:false,
chkDisabledInherit:false,
radioType:“level”
}*/
};