asp+sql做分類樹如何?(無限極)

來源:互聯網
上載者:User

getObjectById("TimeShow").innerHTML = "載入本頁耗時 "+ (new Date().getTime()-t1) +" 毫秒";
    }
    </SCRIPT>
  </head>

  <body>
    <h3>梅花雪WEB指令碼控制項集 - MzTreeView 1.0 樹 - 測試頁面</h3>
    <form method="get" style="padding: 3; background-color: #B8D1F8; margin-bottom: 0">
      <fieldset>
        <legend>輸入樹節點參數資訊</legend>
        樹的總節點數:<input name="total" size='8' maxlength='8' value="1024">
        每節點的子節點數:<input name="childNodes" size='3' maxlength='3' value="10">
        <input type="submit" value="確定">
      </fieldset>
    </form>
    <table width="100%" border=0 cellspacing=3 bgcolor="#B8D1F8">
      <tr>
        <td bgcolor=white valign=top>
          <div id=treeviewarea style="background-color: "></div>
          <SCRIPT LANGUAGE="JavaScript">
          <!--
          var tree = new MzTreeView("tree");
          tree.setIconPath("./");
          tree.nodes['0_1'] = 'text:節點 1';
          tree.nodes['1_2'] = 'text:節點 2';
          tree.nodes['1_3'] = 'text:節點 3';
          tree.nodes['1_4'] = 'text:節點 4';
          tree.nodes['1_5'] = 'text:節點 5';
          tree.nodes['1_6'] = 'text:節點 6';
          tree.nodes['1_7'] = 'text:節點 7';
          tree.nodes['1_8'] = 'text:節點 8';
          tree.nodes['1_9'] = 'text:節點 9';
          tree.nodes['1_10'] = 'text:節點 10';
          var tot = getQuery("total");      tot = !tot || isNaN(tot) ? 1024 : tot;
          var cns = getQuery("childNodes"); cns = !cns || isNaN(cns) ? 10 : cns;
          with(document.forms[0])
          {
            total.value = tot;
            childNodes.value = cns;
          }
          for (i=11; i<tot; i++)
            tree.nodes[Math.floor(Math.random()*(tot/cns))+2 +"_"+ i] = 'text:節點 '+ i;



          document.getElementById('treeviewarea').innerHTML = tree.toString();

          
          
          if(typeof(Function.prototype.apply)!="function")
          {
            Function.prototype.apply = function(obj, argu){var s; if(obj){obj.constructor.prototype._caller=this; s = "obj._caller";} else s = "this"; var a=[]; for(var i=0; i<argu.length; i++) a[i] = "argu["+ i +"]"; return eval(s +"("+ a.join(",") +");");};
            Function.prototype.call  = function(obj){var a=[]; for(var i=1; i<arguments.length; i++) a[i-1]=arguments[i]; return this.apply(obj, a);}; 
          }
          tree.buildNode = function(id)
          {
            var d = new Date().getTime();

            MzTreeView.prototype.buildNode.call(this, id);

            try{
            getObjectById("TimeNode").innerHTML = "<u><b>"+ this.node[id].text +"</b></u> 有 "+
              this.node[id].childNodes.length +" 個子節點<br>載入耗時:"+ (new Date().getTime()-d) +" 毫秒!";
            }catch(e){}
          }
          tree.expandAll = function()
          {
            var d = new Date().getTime();
            MzTreeView.prototype.expandAll.call(this);
            alert("全部展開耗時 = "+ (new Date().getTime()-d) +
            " 毫秒!\r\n有效節點總數 = "+ (this.index+1));
          }
          //-->
          </SCRIPT>
        </td><td width="230" valign=top>
        ·<u><a href="http://www.meizz.com/Web/Article.asp?id=436" target="_blank">使用說明</a></u><br>
        ·<u><a href="http://www.meizz.com/Web/Download/MzTreeView10.rar" target="_blank">下載 MzTreeVew V1.0</a></u><br><br>
        聚焦到<input id=focusId size=5>節點<input type=button value="聚集" onClick="tree.focus(getObjectById('focusId').value)"><br>
        <input type=button value="父層節點←" onClick="tree.upperNode()"><input type=button value="子層節點→" onClick="tree.lowerNode()"><br>
        <input type=button value="上一節點↑" onClick="tree.pervNode()"><input type=button value="下一節點↓" onClick="tree.nextNode()"><br>
        <input type=button value=展開所有節點 onClick="tree.expandAll()"><br>
        <br><ul style="line-height: 14pt">
        <li id=msgNode >1024 個節點的樹!
        <li id="TimeShow" style="color: #0000D0">在這裡可以看到每個節點載入的耗時
        <li id="TimeNode">
        </ul></td>
      </tr>
    </table>
  </body>
</html>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.