When you use the TreeView Control for Rights Management, you need to use the checkbox select All.
Tick the parent node and select all child nodes. Cancels the parent node, and the child node is not selected.
Subtask node, the parent node is also selected.
The following are examples of use:
<asp:treeview id="tvpermission" runat="server " nodeindent= "target="mainFrame "Expanddepth= "2" showcheckboxes="all"/>
TreeView Control
protected void Page_Load (object sender, EventArgs e) { if (! IsPostBack) { TVPermission.Attributes.Add ("OnClick"," ontreenodechecked ()"); } }
Page Load
1<script type = "Text/javascript" >2 functionontreenodechecked () {3 varEle =event.srcelement;4 if(ele.type== ' checkbox ') {5 varChildrendivid = Ele.id.replace (' CheckBox ', ' Nodes ');6 vardiv =document.getElementById (childrendivid);7 8 if(div! =NULL) {9 varCheckboxs = Div.getelementsbytagname ("INPUT");Ten for(vari = 0; i < checkboxs.length; i++) { One if(Checkboxs[i].type = = ' checkbox ') { Acheckboxs[i].checked =ele.checked; - } - } the } - Checkon (ele); - } - } + functionCheckon (obj) { - varDiv1 = Webform_getparentbytagname (obj, ' DIV '); + if(Div1! =NULL) { A varCheckboxs = Div1.getelementsbytagname (' INPUT '); at varParentcheckboxid = Div1.id.replace (' Nodes ', ' CheckBox '); - varParentcheckbox =document.getElementById (PARENTCHECKBOXID); - - if(Parentcheckbox! =NULL) { -parentcheckbox.checked =true; - Checkon (parentcheckbox); in Checkon (parentcheckbox); - } to } + } -</script>
Front-end scripting
TreeView checkbox Select All