如果检查子节点后将检查该根节点 [英] if child node checked after that root will be checked

查看:64
本文介绍了如果检查子节点后将检查该根节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友

请帮帮我

我已经工作过treeview1控件。我的问题是检查所有子节点,然后检查root,如果检查一个子节点,则会检查root。





谢谢

dear friends
please help me
I have worked treeview1 control . my problem is all child node checked then root will be checked and IF one child node will checked then root will be checked.


thanks

推荐答案

请参阅以下示例代码。可能会有帮助...





Please refer the following sample code. May it helps...


var TreeView = "<%=TreeView1.ClientID %>"
var checkboxs = document.getElementById(TreeView).getElementsByTagName("INPUT")
for(i=0;i<checkboxs.length;i++)>
{
  if(checkboxs[i].type == "checkbox"
    &&  checkboxs[i].name.substr(0,TreeView.length) == TreeView
    && checkboxs[i].checked )
  {
      //Do what you want to do.
  }
}


这篇关于如果检查子节点后将检查该根节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆