如下图的设计,这是一个树形菜单,但是研究数据库之后发现,这些数据全部都是存在数据库中的,
他数据库中有一个标识字段,比如高中、初中、小学是第一级菜单,下面的是第二级、第三级,
估计程序中在做个判断,所以会形成如下的树形结构。不过,本人怎么都觉得这样设计怪怪的,请问各位有没更好的设计啊,不搞成树形菜单也可以,本人比较讨厌树形菜单,而且东西很多的时候 要拉很长。。
谢谢、。
他数据库中有一个标识字段,比如高中、初中、小学是第一级菜单,下面的是第二级、第三级,
估计程序中在做个判断,所以会形成如下的树形结构。不过,本人怎么都觉得这样设计怪怪的,请问各位有没更好的设计啊,不搞成树形菜单也可以,本人比较讨厌树形菜单,而且东西很多的时候 要拉很长。。
谢谢、。
解决方案 »
- 一段简单的js问题:我想让表单提交之后自动关闭,现在没提交就已经关闭了
- ****************求一段简单的触发器代码 Sql Server 2008 ***************
- MyEclipse8里面添加Hibernate ORM/DAO LIB 怎么没有这个选项?
- hibernate 一对多查询 对多的一方进行分页,怎么弄!!!
- 急!!!RMB 求一个java服务器gsoap客户断 要求能上传下载图片文件
- 大家有用过JIVE的吗?
- 关于保存生成文件的问题,谢谢!
- [高分救助]JBuilder+Weblogic开发CMP的数据源问题
- 在struts的action里实现下载功能时报错“Cannot forward after response has been committed” 该如何解决?内有原码
- JBuilderX+Weblogic8.1运行struts时出错,请问怎样解决?(内详,在线等)
- 从mysql数据库中取得中文,如何在jsp页面显示
- linux下下载文件的路径问题
1、层级编码结构,每层编码固定,层次之间根据上级编码一致性来匹配,类似于:xxx xxxooo xxxoooyyy
2、父子节点id,类似于:myId, parentId其实都各有优缺点,看场景选用吧。
而这些节点,我想移动到右边,也就是框架的main 区域这个页面再来进行这样的设计也就是说 树形菜单 我设计成一个连接接一个连接 <A href="">这种通过链接来跳转,不过没有做过,不知道页面上好实现不呢~
<html>
<head>
<script>
function getChild(imageObject)
{
var tableTree = document.getElementById("tableTree");
var currentRow = imageObject.parentNode.parentNode;
var imageCount = currentRow.getElementsByTagName("img").length;
var currentRowIndex = 0; for(currentRowIndex = 0;currentRowIndex < tableTree.rows.length;currentRowIndex++)
{
if(tableTree.rows[currentRowIndex] == currentRow)
{
break;
}
} if(imageObject.src.indexOf("_plus1.gif") != -1)
{
imageObject.src = imageObject.src.replace("http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_plus1.gif","http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_minus1.gif");
var newTr = tableTree.insertRow(currentRowIndex+1);
var newTd = newTr.insertCell(0); var imageStr = "";
for(var i = 0;i < imageCount;i++)
{
imageStr += "<img src='http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_line4.gif'/>";
}
newTd.innerHTML = imageStr + "<img onclick='getChild(this)' src='http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_plus1.gif'/>子节点";
}
else
{
imageObject.src = imageObject.src.replace("http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_minus1.gif","http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_plus1.gif"); for(var i = currentRowIndex+1;i < tableTree.rows.length;i++)
{
if(tableTree.rows[i].getElementsByTagName("img").length > currentRow.getElementsByTagName("img").length)
{
tableTree.deleteRow(i);
--i;
}
else
{
break;
}
}
}
}
</script>
</head>
<body>
<table id="tableTree" style="border:1px solid gray;border-collapse:collapse;width:100%;" cellpadding="0" cellspacing="0">
<tr>
<td><img onclick="getChild(this)" src="http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_plus1.gif"/>顶级节点</td>
</tr>
<tr>
<td><img onclick="getChild(this)" src="http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_plus1.gif"/>顶级节点</td>
</tr>
<tr>
<td><img onclick="getChild(this)" src="http://community.csdn.net/ui/scripts/System/_resource/MzTreeView/_plus1.gif"/>顶级节点</td>
</tr>
</table>
</body>
</html>