日期:2014-05-17  浏览次数:20671 次

dhtmltree采用生成好的字符串加载生成树?无法正确加载xml字符串?
xml字符串ss内容如下
<?xml version="1.0" encoding="iso-8859-1"?>
<tree id="0" >
<item   text="Books" id="books" im0="book.gif" im1="books_open.gif" im2="books_close.gif" child="1">
<item text="Mystery &amp; Thrillers" id="mystery" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" child="1">
</item>
</item>
</tree>
采用
tree=new dhtmlXTreeObject("doctree_box","100%","100%",1);
tree.setImagePath("<%=request.getContextPath()%>/imgs/"); 
 tree.loadXML(ss);
提示
Errot type:LoadXML 
Description:Incorrect XML 

Error type:DataStructure 
Description:Xml reffers to not existing parent 


请大家帮忙解决一下。
------解决方案--------------------
tree Id 和你创建树的Id不同 ,你的 tree ID是0,创建 treeObjectId 为 1

------解决方案--------------------
你的问题解决了吗?我也遇到了同样的问题
------解决方案--------------------
我也遇到了这个问题,你解决了希望能够将方法说下啦~~~