数据表 SM_Menu
Name Parent MID Url (MID关键字,自增长)
<html>
<head>
var objMenuXml;
var GlobalMID="";
var GlobalMName="";
var GlobalPMID="";
var GlobalPMName="";
function Win_load()
{
var NodeList = objMenuXml.selectNodes("//SM_Menu[Parent=0]"); //zhangxn
menus.innerHTML = buildMenus(NodeList,0);
}
function buildMenus(xmlClds,nPace)
{
var sOutHtml = "<table border=0 >";
for(var i=0;i<xmlClds.length;i++)
{
var nMenuID = xmlClds[i].selectSingleNode("MID").text;
var sUsers = xmlClds[i].selectSingleNode("Name").text;
var sDisabled ="";
if(Trim(xmlClds[i].selectSingleNode("Url").text) == "")
{
sOutHtml += "<tr><td><div style='position:relative;left:" + nPace*15 + "px;'>";
sOutHtml += "<img src='../images/bnclose.gif' id='mimg" + nMenuID + "' onclick='javascript:openclose(mimg" + nMenuID + ",mdiv" + nMenuID + ","+nMenuID+","+eval(nPace+1)+" );' style='position:relative;top:-1px;'>";
sOutHtml += "<a class='ctltxt' href='javascript:openclose(mimg" + nMenuID + ",mdiv" + nMenuID +" ,"+nMenuID+","+eval(nPace+1)+" );'>" + xmlClds[i].selectSingleNode("Name").text + "</a>";
sOutHtml += "</div><input type='hidden' width='0' id='hidTxt"+nMenuID+"' value='0'></td><tr>";
sOutHtml += "<tr><td><div id=mdiv" + nMenuID + " style='display:none'>";
sOutHtml += "</div></td></tr>";
}
else
{
sOutHtml += "<tr><td><div style='position:relative;left:" + (nPace*15+9) + "px;'>";
sOutHtml += "<a href='javascript:checkRegedit(" + nMenuID + ")'>" + xmlClds[i].selectSingleNode("Name").text + "</a>";
sOutHtml += "</div></td></tr>";
}
}
sOutHtml += "</table>";
return sOutHtml;
}
function openclose(img,div,id,space)
{
GlobalMID = id;
GlobalMName = objMenuXml.selectSingleNode("//SM_Menu[MID="+GlobalMID+"]/Name").text;
GlobalPMID = objMenuXml.selectSingleNode("//SM_Menu[MID="+GlobalMID+"]/Parent").text;
if (GlobalPMID == "0")
GlobalPMName = "一级菜单";
else
GlobalPMName = objMenuXml.selectSingleNode("//SM_Menu[MID="+GlobalPMID+"]/Name").text;
if (img == 0 )
return;
var tmpTxt;
eval("tmpTxt=hidTxt"+GlobalMID+".value");
if(div.style.display == "none")
{
img.src = "../images/bnopen.gif";
if(tmpTxt == '0')
{
div.innerHTML = buildMenus(objMenuXml.selectNodes("//SM_Menu[Parent="+GlobalMID+"]"),space);
eval("hidTxt"+GlobalMID+".value=1");
}
div.style.display = "block";
}
else
{
img.src = "../images/bnclose.gif";
div.style.display = "none";
}
}
</head>
<body onload=win_onload()>
<div id=menus style="BORDER-RIGHT: #6369a5 1px solid; TABLE-LAYOUT: fixed; BORDER-TOP: #6369a5 1px solid; PADDING-LEFT: 7px; MARGIN: 8px 1px 10px; OVERFLOW: auto; BORDER-LEFT: #6369a5 1px solid; WIDTH: 99%; PADDING-TOP: 5px; BORDER-BOTTOM: #6369a5 1px solid; HEIGHT: 95%"
align=left></div>
</body>
</html>