提交修改

master
dsh 1 year ago
parent 828469023e
commit 58ea36bb02

@ -26,9 +26,10 @@ function createHttpRequest() {
function buildOptions(xmlDoc,id) {
var selectObj = document.getElementById(id);
if (!selectObj || selectObj.tagName!="SELECT") {
if (!selectObj || selectObj.tagName!="TR") {
return;
}
var selectObjNew = selectObj.childNodes[3].childNodes[1]
var options = xmlDoc.getElementsByTagName("option");
//clear select object
// for (var i = selectObj.length-1 ; i >= 0 ; i--){
@ -38,10 +39,9 @@ function buildOptions(xmlDoc,id) {
for (var i=0; i<options.length; i++) {
var len = selectObj.length;
selectObj.length = len + 1;
selectObj.options[len].value = options[i].attributes[0].nodeValue;
selectObj.options[len].text = options[i].attributes[1].nodeValue;
selectObjNew.options[len] = new Option(options[i].attributes[1].nodeValue, options[i].attributes[0].nodeValue);
if (options[i].attributes[2].nodeValue =="selected") {
selectObj.options[len].selected = true;
selectObjNew.options[len].selected = true;
}
}
}

@ -190,7 +190,7 @@ function saveMenu() {
</td>
</tr>
<tr height='30' id="submenu">
<td class='cell2' width="100"><a href="javascript:addNode('submenuid','0')">增加文件夹</a></td>
<td class='cell2' width="100"><a href="javascript:addNode('submenu','0')">增加文件夹</a></td>
<td class='cell2'>
<select name="subMenuid"></select>
</td>
@ -251,7 +251,7 @@ function setOptions() {
if (xmlObj) {
var options = xmlObj.getElementsByTagName("options");
buildOptions(options[0],"toMenuid");
buildOptions(options[1],"subMenuid");
buildOptions(options[1],"submenu");
buildOptions(options[2],"func");
}
}
@ -287,10 +287,11 @@ function addNode(objName,type) {
if (upmenuid) {
var menuname="",menuid="",pos=-1;
var obj = document.getElementById(objName);
for (var i=0; i<obj.length; i++) {
if (obj[i].selected==true) {
menuname = obj.options[i].text;
menuid = obj.options[i].value;
var objNew = obj.childNodes[3].childNodes[1]
for (var i=0; i<objNew.length; i++) {
if (objNew[i].selected==true) {
menuname = objNew.options[i].text;
menuid = objNew.options[i].value;
pos = i;
break;
}
@ -305,7 +306,7 @@ function addNode(objName,type) {
var menuitem = eval("tree" + upmenuid);
eval("tree"+menuid+"=new WebFXTreeItem(menuname,\"javascript:oper('"+ menuid +"','"+ menuname +"','"+ upmenuid +"','"+ type +"')\")");
menuitem.add(eval("tree"+menuid));
removeOption(obj,pos);
removeOption(objNew,pos);
} else {
alert("请选择一个节点!");
}

Loading…
Cancel
Save