日期:2014-05-18  浏览次数:20686 次

怎么用梅花雪树形控件从数据库动态显示
我用的是Oracle数据库,按照梅花雪大师的说明间的数据库表名为Tree,请各位高手帮我实现目录树的动态显示,我最近急着用啊,最好做成Structs模式的,帮我解决我肯定给分啊!!!!要是能实现添加、删除等功能的话那就更好了。

------解决方案--------------------
给你个我做过的
<%@ page contentType= "text/html; charset=gb2312 " language= "java "%>
<%@ include file= "check.jsp "%>
<link rel= "stylesheet " href= "css/style_1.css ">
<script type= "text/javascript " src= "js/MzTreeView10.js "> </script>
<script language= "JavaScript " src= "js/Right_shielding.js "> </script>
<script type= "text/javascript ">
<!--
var tree = new MzTreeView( "tree ");
tree.setIconPath( "TreeView/ ");
<%
String xzqh_no=(String)session.getAttribute( "XZQH_NO ");
String str_where= " ";
//利用组合查询实现通过T_PUB_XZQH表的xzqh_no字段显示数据以达到快速定位
if((xzqh_no.equals( "all ")) || (xzqh_no.equals(null))){
str_where= " ";
}else if(xzqh_no.equals( "000000 ")){
str_where = " ";
}else if(xzqh_no.substring(2).equals( "0000 ")){
str_where = "where XZQH_NO like ' "+xzqh_no.substring(0,2)+ "% ' or xzqh_no like '000000 ' ";
}else if(xzqh_no.substring(4).equals( "00 ")){
str_where = "where XZQH_NO like ' "+xzqh_no.substring(0,4)+ "% ' or XZQH_NO like ' "+xzqh_no.substring(0,2)+ "0000 ' or xzqh_no like '000000 ' ";
}else{
str_where = "where XZQH_NO= ' "+xzqh_no+ " ' or XZQH_NO like ' "+xzqh_no.substring(0,4)+ "00 ' or XZQH_NO like ' "+xzqh_no.substring(0,2)+ "0000 ' or xzqh_no like '000000 ' ";
}
String sql= " ";
String TopMenuTitle= " ";
sql = "select THIS_ID,PARE_ID,xzqh_name,xzqh_no from frsm.t_pub_xzqh "+str_where+ " order by XZQH_NO ";
TopMenuTitle= "所有行政区划 ";
%>
tree.nodes[ "0_1 "] = "text: <%=TopMenuTitle%> ;data:this_id=all; ";
<%

sqlbean.executeQuery(sql);
while(sqlbean.next()){
%>
//父id,子id
tree.nodes[ " <%=sqlbean.getData(2)%> _ <%=sqlbean.getData(1)%> "] = "text: <%=sqlbean.getData(3)%> ; data:xzqhno= <%=sqlbean.getData(4)%> ";
<%
}
%>
tree.setURL( "act_xzqh_area.jsp ");
tree.setTarget( "pubmenu ");//页面打开方式
document.write(tree.toString());
//-->
</script>

------解决方案--------------------
你的代码好乱,看不懂。
给你个我写的
<%@page contentType= "text/html; charset=GBK "%>
<jsp:useBean id= "t " class= "tree.tree " scope= "page "> </jsp:useBean>
<html>
<head>
<title> jsp10 </title>
</head>
<style type= " ">
A.MzTreeview
{
font-size: 9pt;
padding-left: 3px;
}
</style>
<script language= "JavaScript " src= "MzTreeView10.js " type= " "> </script>
<script language= "JavaScript " type= " ">
var tree = new MzTreeView( "tree ");
tree.icons[ "property "] = &quo