Ext.NET控件TreePanel全选与反选
<%@ Page Language="C#" %> <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Ext.NET Example</title> <script type="text/javascript"> </script> </head> <body> <form runat="server"> <ext:ResourceManager runat="server" /> <ext:TreePanel ID="TreePanel1" runat="server" Height="300"> <Root> <ext:TreeNode Text="Composers" Expanded="true" Checked="False"> <Nodes> <ext:TreeNode Text="Beethoven" Expanded="true" Checked="False"> <Nodes> <ext:TreeNode Text="Concertos" Expanded="true" Checked="False"> <Nodes> <ext:TreeNode Text="Concert 1" Checked="False" /> <ext:TreeNode Text="Concert 2" Checked="False" /> </Nodes> </ext:TreeNode> </Nodes> </ext:TreeNode> </Nodes> </ext:TreeNode> </Root> <Buttons> <ext:Button runat="server" Text="Check all"> <Listeners> <Click Handler="#{TreePanel1}.getRootNode().cascade(function(n){n.ui.toggleCheck(true);});" /> </Listeners> </ext:Button> <ext:Button runat="server" Text="Uncheck all"> <Listeners> <Click Handler="#{TreePanel1}.getRootNode().cascade(function(n){n.ui.toggleCheck(false);});" /> </Listeners> </ext:Button> </Buttons> </ext:TreePanel> </form> </body> </html>