tree.expandAll();是展開所有節點
我的意思是刷新页面的时候节点就不能展开
那个+号点击没反映.
要点击其中某个节点后页面重新进入,节点才能展开

解决方案 »

  1.   

    <script language="JavaScript">
      var tree = new MzTreeView("tree");  tree.icons["property"] = "property.gif";
      tree.icons["css"] = "collection.gif";
      tree.icons["book"]  = "book.gif";
      tree.iconsExpand["book"] = "bookopen.gif"; //展开时对应的图片  tree.setIconPath("MzTreeView10/"); //可用相对路径
      tree.nodes["0_1"] = "text:Products;method:tree.expandAll();";
    tree.nodes["1_2005"] = "text:水产种苗;url:?fcid=5";
    tree.nodes["2005_3007"] = "text:鱼苗;url:?secid=7";
    tree.nodes["3007_4005"] = "text:国内淡水鱼苗;url:?secid=5";
    tree.nodes["3007_4006"] = "text:国外淡水鱼苗;url:?secid=6";
    tree.nodes["3007_4007"] = "text:国内海水鱼苗;url:?secid=7";
    tree.nodes["3007_4008"] = "text:国外海水鱼苗;url:?secid=8";
    tree.nodes["2005_3008"] = "text:观赏鱼;url:?secid=8";
    tree.nodes["3008_4009"] = "text:热带鱼;url:?secid=9";
    tree.nodes["3008_40010"] = "text:中国金鱼;url:?secid=10";
    tree.nodes["1_2006"] = "text:水产冻品;url:?fcid=6";
    tree.nodes["2006_3009"] = "text:加工食品;url:?secid=9";
    tree.nodes["2006_30010"] = "text:海捕原产品;url:?secid=10";
    tree.nodes["2006_30011"] = "text:杂小鱼种;url:?secid=11";
    tree.nodes["1_2007"] = "text:绿色食品;url:?fcid=7";
    tree.nodes["2007_30012"] = "text:保健食品;url:?secid=12";
    tree.nodes["2007_30013"] = "text:普通食品;url:?secid=13";
    tree.nodes["2007_30014"] = "text:调味品;url:?secid=14";
    tree.nodes["1_2008"] = "text:专业考察;url:?fcid=8";
    tree.nodes["1_2009"] = "text:其他贸易;url:?fcid=9";  //tree.setURL("?");
      tree.setTarget("");
      document.write(tree.toString());    //亦可用 obj.innerHTML = tree.toString();
    </script>
      

  2.   

    tree.nodes["0_1"] = "text:Products;method:tree.expandAll();";
    把method的内容去掉看看.
      

  3.   

    tree.nodes["0_1"] = "text:Products;method:tree.expandAll();";把method的内容去掉也是展不开我是因为展不开才暂时用这方法 在开始就展开全部节点的