问题描述
如题 问题补充:renpeng301 写道
解决方案
[{"id":1,"text":"校准计划表","children":[{"id":2,"text":"2011年度","children":[],"pid":1,"leaf":true}],"pid":0,"leaf":false},{"id":3,"text":"校准台账","children":[{"id":4,"text":"aaa队","children":[],"pid":3,"leaf":true}],"pid":0,"leaf":false},{"id":5,"text":"试验检测计划表","children":[{"id":6,"text":"2012","children":[],"pid":5,"leaf":true}],"pid":0,"leaf":false},{"id":7,"text":"试验检测台账","children":[{"id":8,"text":"aaa队","children":[],"pid":7,"leaf":true}],"pid":0,"leaf":false},{"id":9,"text":"加工计划表","children":[{"id":10,"text":"2012年度","children":[],"pid":9,"leaf":true}],"pid":0,"leaf":false},{"id":11,"text":"维修记录","children":[{"id":12,"text":"aaa队","children":[],"pid":11,"leaf":true}],"pid":0,"leaf":false},{"id":13,"text":"系统设置","children":[{"id":14,"text":"用户信息维护","children":[],"pid":13,"leaf":true},{"id":15,"text":"角色信息维护","children":[],"pid":13,"leaf":true}],"pid":0,"leaf":false}]这个不是你的tree请求回来的数据吗?如果有数据返回,说明请求已经发起了
解决方案二:
还有你el:'tree-div',是不是写错了,“el”属性从文档上看,它是只读的,应该是renderTo: 'tree-div',
解决方案三:
var tree = Ext.tree;var tree= new Tree.TreePanel({ 你把命名空间赋值给tree,这里应该是“Tree”,不知道是你把代码贴上来写错了呢,还是本身就写错了。
解决方案四:
Ext.onReady(function() {var Tree= Ext.tree;var tree = new Tree.TreePanel({el:'tree-div', autoScroll:true, animate:true, enableDD:true, containerScroll: true,loader: new Tree.TreeLoader({dataUrl:'rightAction.action'})});var root =new Tree.AsyncTreeNode({text:"可用权限列表",draggable:false,id:'0'});tree.setRootNode(root);tree.render();root.expand();});这样才对····
解决方案五:
晕啊 var Tree = Ext.tree; 这样定义的啊···你大小写写错了···
解决方案六:
}, { "id" : 15 //这里的逗号呢 ??怎么没有呢?? 数据有问题吧"text" : "角色信息维护", "children" : [], "pid" : 13, "leaf" : true }], "pid" : 0, "leaf" : false }]
解决方案七:
改下配置<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"><struts><constant name="struts.devMode" value="true"></constant><constant name="struts.i18n.encoding" value="UTF-8"></constant><package name="default" extends="struts-default"><action name="rightAction" method="execute" class="com.dg.dtjc.sys.role.vo.web.RightAction"> <result type="json"></result> </action></package>
解决方案八:
json数据已经传到前台么? 用firebug看看··
解决方案九:
直接 json-lib把···struts2 jsonplugin生成的json少了[],extjs tree需要[]的啊·非常酷的树:Struts2 + JSON + Extjs Tree[url]http://www.iteye.com/topic/309416[/url]