// JScript 文件
function getParentByTagName(element, tagName)
{
var parent = element.parentNode;
var upperTagName = tagName.toUpperCase();
while (parent && (parent.tagName.toUpperCase() != upperTagName))
{
parent = parent.parentNode ? parent.parentNode : parent.parentElement;
}
부모 반환;
}
function setParentChecked(objNode)
{
var objParentDiv = getParentByTagName(objNode,"div");
if(objParentDiv == null || objParentDiv == "정의되지 않음")
return;
var objID = objParentDiv.getAttribute("ID");
var objParentCheckBox = document.getElementById(objID.replace("Nodes","CheckBox"));
if(objParentCheckBox == null || objParentCheckBox == "정의되지 않음")
return;
if(objParentCheckBox.tagName!="INPUT" && objParentCheckBox.type == "checkbox")
return;
//추가
// if (objNode.checked=false) objPraentCheckBox.checked=false;
// objParentCheckBox.checked = true;
setParentChecked(objParentCheckBox);
}
function setParentUnChecked(objNode)
{
var objParentDiv = getParentByTagName(objNode,"div");
if(objParentDiv == null || objParentDiv == "정의되지 않음")
return;
var objID = objParentDiv.getAttribute("ID");
var objParentCheckBox = document.getElementById(objID.replace("Nodes","CheckBox"));
if(objParentCheckBox == null || objParentCheckBox == "정의되지 않음")
return;
if(objParentCheckBox.tagName!="INPUT" && objParentCheckBox.type == "checkbox")
return;
//추가
// if (objNode.checked=false) objPraentCheckBox.checked=false;
objParentCheckBox.checked = false;
setParentUnChecked(objParentCheckBox);
}
function setChildCheckedState(div,state)
{
var objchild = div.childNodes;
var 개수 = objchild.length;
for(var i=0;i{
var tempObj = objchild[i];
if(tempObj.tagName=="INPUT" && tempObj.type == "checkbox")
{
tempObj.checked = state;
}
// 디버거;
setChildCheckedState(tempObj,state);
}
}
function TreeNodeChecked()
{
var objNode = window.event.srcElement;
if(objNode.tagName!="INPUT" || objNode.type!="checkbox")
return;
// 디버거;
if(objNode.checked == true)
{
setParentChecked(objNode);
}
else
{
setParentUnChecked(objNode);
}
var objID = objNode.getAttribute("ID");
var objParentDiv = document.getElementById(objID.replace("CheckBox","Nodes"));
if(objParentDiv==null || typeof(objParentDiv) == "정의되지 않음")
return;
setChildCheckedState(objParentDiv,objNode.checked);
}
function SetTreeNodeChecked(objNode1)
{
var objNode =objNode1;
var objID = objNode.getAttribute("ID");
var objParentDiv = document.getElementById(objID.replace("CheckBox","Nodes"));
if(objParentDiv==null || typeof(objParentDiv) == "정의되지 않음")
return;
setChildCheckedState(objParentDiv,objNode.checked);
}
function GetYHQS(id)
{
PageMethods.CallYHQX(id,callsuccessed);
}
함수 호출 성공(결과)
{
// //循环页면
//debugger;
for (i=0;i{
var objNode=document.form1.elements[i];
if (objNode.tagName=="INPUT" && objNode.type=="checkbox")
{
objNode.checked=false;
}
}
for (i=0;i{
var objNode=document.form1.elements[i];
if (objNode.tagName=="INPUT" && objNode.type=="checkbox")
{
//找到
//比较
if (result.indexOf(objNode. 제목)!=-1)
{
objNode.checked=true;
SetTreeNodeChecked(objNode);
}
}
}
}
함수 테스트()
{
디버거;
//循环页면
for (i=0;i{
var objNode=document.form1.elements[i];
if (objNode.tagName=="INPUT" && objNode.type=="checkbox")
{
//找到
//比较
objNode.checked=true;
}
}
}