日期:2014-05-16 浏览次数:20432 次
function getTR() { var obj=event.srcElement; while (obj.tagName !="TR") { obj = obj.parentElement; } return obj; }
function endWidth(s1,s2){ if(s1.length < s2.length){ return false; } if(s1 == s2){ return false; } if(s1.substring(s1.length-s2.length) == s2){ return true; } return false; }
function addParameterRow(tableid){ var parameterObj = document.getElementById(tableid); var newTr = parameterObj.insertRow(); var newTd0 = newTr.insertCell(); var newTd1 = newTr.insertCell(); var newTd2 = newTr.insertCell(); if (tableid == "addons_kenerlParameters") { newTd0.innerHTML = '<input name="kenerlParamGroup" type="text" size="20" maxlength="32"/>'; newTd1.innerHTML = '<input name="kenerlParamName" type="text" size="20" maxlength="32"/>:<input name="kenerlParamValue" type="text" size="20" maxlength="32"/>'; newTd2.innerHTML = '<input name=btnAddKenerlParam type=button class=button value=添加 onclick=addParameterRow("addons_kenerlParameters") style=cursor:hand/> <input name=delAddKenerlParam type=button class=button value=删除 onclick=delRow("addons_kenerlParameters") style=cursor:hand/>'; } else if (tableid == "addons_hardwareTypeParameters") { newTd0.innerHTML = '机房:<input name="dataCenter" type="text" size="15" maxlength="20" />'; newTd1.innerHTML = '硬件类型:<input name="serviceType" type="text" size="15" maxlength="10" />'; newTd2.innerHTML = '<input name=btnAddHardwareTypeParam type=button class=button value="添加" onclick=addParameterRow("addons_hardwareTypeParameters") style=cursor:hand/> <input name=delAddHardwareTypeParam type=button class=button value=删除 onclick=delRow("addons_hardwareTypeParameters") style=cursor:hand/>'; } else { newTd0.innerHTML = '<input name="functionParamGroup" type="text" size="20" maxlength="32"/>'; newTd1.innerHTML = '<input name="functionParamName" type="text" size="20" maxlength="32"/>:<input name="functionParamValue" type="text" size="20" maxlength="32"/>'; newTd2.innerHTML = '<input name=btnAddFunctionParam type=button class=button value=添加 onclick=addParameterRow("addons_functionParameters") style=cursor:hand/> <input name=delAddFunctionParam type=button class=button value=删除 onclick=delRow("addons_functionParameters") style=cursor:hand/>'; } newTd0.align = "center"; newTd1.align = "center"; newTd2.align = "center"; }