var zTree = $.fn.zTree.getZTreeObj('userDemo'); //ztree对象 console.log(zTree); var nodeChecked=zTree.getNodeByParam("loginName",userName);//得到选中的节点 zTree.checkNode(nodeChecked,!nodeChecked.checked, true); nodeChecked.checked = true; zTree.selectNode(nodeChecked,false,false); checked = zTree.getCheckedNodes(true);//得到选中的节点
zTree.checkAllNodes(false);//设置全部为false,不选中节点
zTree.cancelSelectedNode();