如何使TreeView子节点的Check状态与父节点一致?顶者有分!
这段代码是树的代码,能够选择当前节点的check时子节点的状态和父节点一样。
我想加一点功能就是让子节的check为false时,父节点的check为false
但我不懂jscript,不知在哪加
<script type= "text/jscript ">
function client_OnTreeNodeChecked()
{
var obj = window.event.srcElement;
var treeNodeFound = false;
var checkedState;
if (obj.tagName == "INPUT " && obj.type == "checkbox ")
{
var treeNode = obj;
checkedState = treeNode.checked;
do
{
obj = obj.parentElement;
}
while (obj.tagName != "TABLE ")
var parentTreeLevel = obj.rows[0].cells.length;
var parentTreeNode = obj.rows[0].cells[0];
var tables = obj.parentElement.getElementsByTagName( "TABLE ");
var numTables = tables.length
if (numTables > = 1)
{
for (i=0; i < numTables; i++)
{