<asp:Panel ID="Panel1" runat="server" style="width:400px; height:400px; overflow:auto; border:1px solid black;">
<div id="sliders" style="width:200px; height:200px; overflow:auto; border:1px solid black;">
<div id="canDiv" style="width:400px; height:0px;" class="ygtv-checkbox"></div>
</div>
</asp:Panel>
//脚本显示静态树------
<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.9.0/build/treeview/assets/skins/sam/treeview.css">
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.9.0/build/yahoo-dom-event/yahoo-dom-event.js&2.9.0/build/connection/connection-min.js&2.9.0/build/treeview/treeview-min.js"></script>
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.9.0/build/yahoo-dom-event/yahoo-dom-event.js&2.9.0/build/treeview/treeview-min.js"></script>
<script type="text/javascript">
var tree;
var cnt; //counter
var mailbox=new Array(); // to store str
(function() {
function treeInit() {
tree = new YAHOO.widget.TreeView("canDiv"); //create tree obj
var root = tree.getRoot(); // get root element
var root1= new YAHOO.widget.TextNode("Node", root, false);
for (cnt=1;cnt<=20000;cnt++)
{
mailbox[cnt] = new YAHOO.widget.TextNode("Node "+cnt, root1, false);
}
tree.subscribe('clickEvent',tree.onEventToggleHighlight);
tree.setNodesProperty('propagateHighlightUp',true);
tree.setNodesProperty('propagateHighlightDown',true);
tree.render();
//alert("after tree render");
}//end of treeInit
YAHOO.util.Event.addListener(window, "load", treeInit);
})();
我试过Panel1.Enabled=false;
但没有为我工作..树控件是雅虎的..现在我正在尝试静态树..当我点击按钮时。它应该禁用面板。
任何帮助都会很棒。谢谢