关于dhtmlxtree的问题

wufeng135 2012-01-10 11:41:41
看网上说可以通过setXMLAutoLoading 异步加载,我代码如下:

tree.xml
<?xml version="1.0" encoding="UTF-8"?>
<tree id="0">
<item text="oooo" id="a0001" child="1">
</item>
</tree>

tree2.xml
<?xml version="1.0" encoding="UTF-8"?>
<tree id="a0001">
<item id="rrr" text="rrr">
</item>
</tree>

tree2的ID和tree.xml的item的ID一样



my.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<link rel="stylesheet" href="<%=path%>/dhtmlxtree/codebase/dhtmlxtree.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript" src="<%=path%>/dhtmlxtree/codebase/dhtmlxcommon.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="<%=path%>/dhtmlxtree/codebase/dhtmlxtree.js"></SCRIPT>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>

<body>
<TABLE style="width:100%;height:100%">
<TR>
<TD>
<div id="tree_swjg" style="width:100%; height:100%;"></div>
</TD>
</TR>
</TABLE>

<script type="text/javascript">

tree=new dhtmlXTreeObject("tree_swjg","100%","100%",0);
tree.setImagePath("dhtmlxtree/codebase/imgs/csh_winstyle/");
tree.enableTreeLines(true);
tree.loadXML("tree.xml");
tree.setXMLAutoLoading("tree2.xml");

</script>
</body>
</html>

想tree2.xml添加到tree.xml中,但不成功!
不知道为什么,



...全文
91 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ascendlin 2012-01-11
  • 打赏
  • 举报
回复
看不懂
wufeng135 2012-01-11
  • 打赏
  • 举报
回复
谁帮我看看啊

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧