jsp页面实现树形显示,树形中的值都是从数据库中读出来的,如下图 15

 我来答
quliuwuy32
2011-03-17 · TA获得超过209个赞
知道答主
回答量:93
采纳率:0%
帮助的人:18.9万
展开全部
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<meta name="KEYWORDS" content="dhtmlxtree, dhtml tree, javascript tree, javascript, DHTML, tree, tree menu, dynamical loading, xml, AJAX, API, cross-browser, checkbox, XHTML, compatible, treeview, navigation, menu, tree control, script, javascript navigation, web-site, dynamic, javascript tree menu, dhtml tree menu, dynamic tree, folder tree, item, node, asp, .net, jsp, cold fusion, custom tag, loading, widget, checkbox, drag, drop, drag and drop, component, html, scand">
<meta name="DESCRIPTION" content="Cross-browser DHTML tree menu with XML support and powerful API. This customizable DHTML JavaScript Tree Menu provides easy way to create efficient JavaScript navigation system.">

<title>DHTML JavaScirpt Tree samples - dhtmlxTree - Changing iconsets</title>

</head>
<style>
body {font-size:12px}
.{font-family:arial;font-size:12px}
h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}
.hdr{
background-color:lightgrey;
margin-bottom:10px;
padding-left:10px;
}
</style>
<body>
<div class="hdr">DHTML JavaScript Tree samples</div>
<h1>Changing iconsets</h1>
<p>dhtmlxTree is highly customizable JavaScript tree menu. You can use different iconsets for trees by chnaging images path.</p>
<link rel="STYLESHEET" type="text/css" href="../css/dhtmlXTree.css">
<script src="../js/dhtmlXCommon.js"></script>
<script src="../js/dhtmlXTree.js"></script>

<table>
<tr>
<td valign="top">
<div id="treeboxbox_tree0" style="width:250; height:218;border :1px solid Silver;; overflow:auto;"></div><br>
<xmp>
tree=new dhtmlXTreeObject("treeboxbox_tree0","100%","100%",0);
tree.setImagePath("../imgs/");
tree.loadXML("tree_b.xml");
</xmp>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td valign="top">
<div id="treeboxbox_tree1" style="width:250; height:218;border :1px solid Silver;; overflow:auto;"></div><br>
<xmp>
tree=new dhtmlXTreeObject("treeboxbox_tree1","100%","100%",0);
tree.setImagePath("../imgs/csh_bluebooks/");
tree.loadXML("tree_b.xml");
</xmp>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="treeboxbox_tree2" style="width:250; height:218;border :1px solid Silver;; overflow:auto;"></div><br>
<xmp>
tree=new dhtmlXTreeObject("treeboxbox_tree1","100%","100%",0);
tree.setImagePath("../imgs/csh_winstyle/");
tree.loadXML("tree_b.xml");
</xmp>
</td>
</tr>
</table>
<hr>

<script>
tree=new dhtmlXTreeObject("treeboxbox_tree0","100%","100%",0);
tree.setImagePath("../imgs/");
tree.loadXML("tree_b.xml");

tree=new dhtmlXTreeObject("treeboxbox_tree1","100%","100%",0);
tree.setImagePath("../imgs/csh_bluebooks/");
tree.loadXML("tree_b.xml");

tree=new dhtmlXTreeObject("treeboxbox_tree2","100%","100%",0);
tree.setImagePath("../imgs/csh_winstyle/");
tree.loadXML("tree_a.xml");
</script>
<br><br>
<p><a href="http://www.scbr.com/docs/products/dhtmlxTree/index.shtml" style="font-weight:bold;">Go to the dhtmlxTree main page</a> or <a href="javascript:self.close()">Close this page</a></p>
</body>
</html>
ylongshao1987
2011-03-17 · TA获得超过9811个赞
知道小有建树答主
回答量:1277
采纳率:100%
帮助的人:713万
展开全部
这个不麻烦啊,先把第一个节点写到div中,下面是空的,给一个onclick事件,点击后在里面添加一个div,到后台查出所有科目,列在div中就可以了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
androidrlj
2011-03-17 · TA获得超过220个赞
知道答主
回答量:82
采纳率:0%
帮助的人:57.5万
展开全部
你可以下载一个Dtree组件看看他的例子就知道了,很简单的!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 2条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式