zTree = $.fn.zTree.getZTreeObj("treeDiv"); //加载ztree的div var node = zTree.getNodeByParam("id",pid ); zTree.cancelSelectedNode(); //取消所有选中 zTree.selectNode(node,true); //选中指定ID的节点 zTree.expandNode(node, true, false); //将指定ID节点展开
zTree = $.fn.zTree.getZTreeObj("treeDiv"); //加载ztree的div var node = zTree.getNodeByParam("id",pid ); zTree.cancelSelectedNode(); //取消所有选中 zTree.selectNode(node,true); //选中指定ID的节点 zTree.expandNode(node, true, false); //将指定ID节点展开