//功能tree
var gnTree;
/*功能树设置定义*/
var gnSetting = {
isSimpleData : true,
treeNodeKey : "yhid",
treeNodeParentKey : "org.organiseId",
nameCol : "xm",
showLine : true,
checkable: true,
async : true,
asyncUrl : '${path}/jsryxx/zgl!getTreeData.action',
asyncParam: ["yhid"],
expandSpeed : 200,
callback : {
// asyncSuccess: function (event, treeId, treeNode, msg){
// zTreeOnAsyncSuccess(event, treeId, treeNode, msg);
// },
click : function(event,treeId,treeNode){
showSubYhs(treeNode);
}
}
};
/*根据父级id检索该机构下的所有用户*/
function showSubYhs(treeNode){
var url = '${path}/jsryxx/zgl!getTreeData.action';
$.ajax({
url: url,
type: 'POST',
async: false,
data: {
organiseId : treeNode.yhid
},
success: function(data){
if(data != '[]'){
if(treeNode.nodes != null){
for(var i = 0; i < treeNode.nodes.length; i++){
gnTree.removeNode(treeNode.nodes[i]);
}
}
var obj=eval('(' + data + ')');
gnTree.addNodes(treeNode, obj, false);
}
},
error: function(data){
alert("请求超时,请刷新!");
}
});
}