//递归去除选中节点的子类节点
function cancelChecked(node){
if(node.isParent){//判断是否为父节点
if(node.zAsync){//判断该节点是否异步加载过子节点(有木有展开)
zTree = $.fn.zTree.getZTreeObj("treeDemo");
var childs = node.children;
for(var i=0;i<childs.length;i++){
zTree.checkNode(childs[i],false,false);//取消子节点的选中
cancelChecked(childs[i]);
}
}
}
}
//递归去除父类节点的的选中
function cancelParentNodeChecked(node){
zTree = $.fn.zTree.getZTreeObj("treeDemo");
if(node.getParentNode()){
zTree.checkNode(node.getParentNode(),false,false);
cancelParentNodeChecked(node.getParentNode());
}
}