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

麻烦帮我看看,我的dojo的tree怎么不好使?谢谢!
我是想实现懒装入,在树刚展开的时候只显示第一层节点,等到要展开具体的第二层节点的时候再到后台去读数据。现在只能展开第一层节点,点击展开节点的那个加号没有反应。麻烦帮我看看是怎么回事。谢谢!

jsp页面如下

<script   type= "text/javascript ">

dojo.require( "dojo.widget.* ");
dojo.require( "dojo.widget.TreeV3 ");
dojo.require( "dojo.widget.TreeNodeV3 ");
dojo.require( "dojo.widget.TreeLinkExtension ");
dojo.require( "dojo.widget.TreeSelectorV3 ");
dojo.require( "dojo.widget.TreeRPCController ");
dojo.require( "dojo.widget.TreeLoadingControllerV3 ");
dojo.require( "dojo.widget.TreeContextMenu ");
dojo.require( "dojo.widget.TreeDocIconExtension ");
dojo.require( "dojo.widget.TreeDisableWrapExtension ");
dojo.hostenv.writeIncludes();
</script>

    <style>
                .myCssClass   {
        font-family:   Arial,   Helvetica,   sans-serif;
                        font-size:   18px;
                        font-style:   italic;
                }
               

.TreeIconTreeNonLeafIconnodetype1{
background-image:   url( ' <%=request.getContextPath()%> /images/mailbox1.gif ');  
}

.TreeIconTreeLeafIconnodetype1{
background-image:   url( ' <%=request.getContextPath()%> /images/closed.gif ');  
}

        </style>
</head>
<body>
<script   type= "text/javascript ">


var   controller   =   dojo.widget.createWidget( "TreeLoadingControllerV3 ",  
{widgetId:   "controller ",   DNDController: "create ",  
RPCUrl:   " <%=request.getContextPath()%> /getMenuTree.do "});
var   link   =   dojo.widget.createWidget( "TreeLinkExtension ",   {widgetId:   "link "});
var   docIcons   =   dojo.widget.createWidget( "TreeDocIconExtension ",   {widgetId:   "docIcons "});
var   disableWrap   =   dojo.widget.createWidget( "TreeDisableWrapExtension ",   {widgetId:   "disableWrap "});
var   treeSelector   =   dojo.widget.createWidget( "TreeSelectorv3 ",   {widgetId:   "treeSelector "});
dojo.event.topic.subscribe( "nodeSelected ", "treeSelectFired ");


dojo.addOnLoad(function(){

//var   kw   =   {url:controller.rpcUrl,   sync: "true "};
//controller.runRpc(kw);

//controller.DNDController   =   "create ";


var   treeNodes   =   <%=request.getAttribute( "strMenus ")%> ;
/*

var   treeNodes   =   [
{ "isFolder ":false, "title ": "title1 ", "tree ": "rootTree ", "objectId ": "775161 ", "widgetId ": "775161 "},
{ "isFolder ":true, "title ": "title2 ", "tree ": "rootTree ", "objectId ": "775162 ", &