仅供参考
function GetSelectValue(combox)
{
for(i=0;i<combox.length;i++)
{
if(combox.options[i].selected)
{
return combox.options[i].value;
}
}
return null;
}
function AddNode()
{
var strPathName=window.location.pathname;
var inParameter="NULL"+","+"NULL"+","+GetSelectValue(document.forms[0].ModelID);
var outResult=showModalDialog(strPathName.substring(0,(strPathName.lastIndexOf('/')+1))+"Define_Node.jsp?Node=NULL&Action=NULL&ModelID="+GetSelectValue(document.forms[0].ModelID),inParameter,"dialogWidth:12;dialogHeight:6;dialogTop:400;dialogLeft:500;status:no;");
if(outResult=="False")
{
}
else
{
var outParameter=outResult.split(",");
var strOutNode=outParameter[0];
var strOutAction=outParameter[1];
var strOutNode_,strOutAction_;
strOutNode_=strOutNode.split("_");
strOutAction_=strOutAction.split("_");
document.forms[0].ListNode.length=document.forms[0].ListNode.length+1;
document.forms[0].ListAction.length=document.forms[0].ListAction.length+1;
var iLen=document.forms[0].ListNode.length;
document.forms[0].ListNode.options[iLen-1].value=strOutNode_[0];
document.forms[0].ListNode.options[iLen-1].text=strOutNode_[1];
document.forms[0].ListAction.options[iLen-1].value=strOutAction_[0];
document.forms[0].ListAction.options[iLen-1].text=strOutAction_[1];
}
}
function DelNode()
{
var iIndex=GetSelectValue(document.forms[0].ListSerial);
var iLen=document.forms[0].ListNode.length;
if(iIndex==iLen)
{
document.forms[0].ListNode.length=document.forms[0].ListNode.length-1;
document.forms[0].ListAction.length=document.forms[0].ListAction.length-1;
}
else
{
for(kIndex=iIndex;kIndex<iLen;kIndex++)
{
document.forms[0].ListNode.options[kIndex-1].value=document.forms[0].ListNode.options[kIndex].value;
document.forms[0].ListNode.options[kIndex-1].text=document.forms[0].ListNode.options[kIndex].text;
document.forms[0].ListAction.options[kIndex-1].value=document.forms[0].ListAction.options[kIndex].value;
document.forms[0].ListAction.options[kIndex-1].text=document.forms[0].ListAction.options[kIndex].text;
}
document.forms[0].ListNode.length=document.forms[0].ListNode.length-1;
document.forms[0].ListAction.length=document.forms[0].ListAction.length-1;
}
}