zTree = $.fn.zTree.getZTreeObj("treeDemo");//treeDemo界面中加載ztree的div var node = zTree.getNodeByParam("id",pid ); zTree.cancelSelectedNode();//先取消全部的選中狀態 zTree.selectNode(node,true);//將指定ID的節點選中 zTree.expandNode(node, true, false);//將指定ID節點展開