• [原创]在树控件中点击一个父结点,所有的子节点都被选中!


    <script language="javascript">
            
    function CheckNode()
             { 
             
    var choose;
             
    var indexid;
             indexid
    =TreeView1.clickedNodeIndex;
            
             choose
    =TreeView1.getTreeNode(indexid).getAttribute('Checked');
             
    var NodeArray=new Array();
              NodeArray
    =TreeView1.getTreeNode(indexid).getChildren();
             
    for(i=0;i<NodeArray.length;i++)
            {
             
    var tempindex=indexid+"."+i;
              NodeArray[i].setAttribute('Checked',choose);
            }
            }
            
    </script>


        <iewc:TreeView id="TreeView1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 96px" runat="server"
                    ExpandLevel
    ="1">
                    
    <iewc:TreeNode CheckBox="True" Text="Node0" Expanded="True">
                        
    <iewc:TreeNode CheckBox="True" Text="Node7"></iewc:TreeNode>
                        
    <iewc:TreeNode CheckBox="True" Text="Node8"></iewc:TreeNode>
                    
    </iewc:TreeNode>
                    
    <iewc:TreeNode CheckBox="True" Text="Node1" Expanded="True">
                        
    <iewc:TreeNode CheckBox="True" Text="Node9"></iewc:TreeNode>
                        
    <iewc:TreeNode CheckBox="True" Text="Node10"></iewc:TreeNode>
                    
    </iewc:TreeNode>
                
    </iewc:TreeView>

    Private Sub Page_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load
            TreeView1.Attributes.Add(
    "oncheck""CheckNode()")
        
    End Sub
  • 相关阅读:
    avrdude: stk500_getsync(): not in sync: resp=0x00
    PCB封装技术
    C/C++基础问题归集
    mf210v 端口的映射
    alsamixer 在音频子系统的使用
    rp2836 网卡以及串口与接插件位置关系
    RP2837 IN1-IN2 对应关系 2路DI
    RP2837 OUT1-OUT2 对应关系 2路DO
    RP2836 板卡信息标识
    RP2836 OUT0-OUT7 对应关系
  • 原文地址:https://www.cnblogs.com/goody9807/p/232418.html
Copyright © 2020-2023  润新知