Extjs tree 页面拿到数据了 但是不显示树

Extjs tree action 返回数据了 但是 页面上什么也没有空白的 firebug 也没报错
页面代码
[code="java"]
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">









[/code]
Exttree.js
[code="java"]var roleid =document.getElementById('roleid').getAttribute('data');

Ext.BLANK_IMAGE_URL = "/dtjcsy/pages/js/ext/resources/images/default/s.gif";
Ext.onReady(function() {

var Tree= Ext.tree;

var loader = new Ext.tree.TreeLoader;
var tree = new Tree.TreePanel({
    el:'tree-div',
    autoScroll:true,
    animate:true,
    enableDD:true,
    frame:false,
    border:false,
    useArrows:true,
    checkModel:'cascade',
    onlyLeafCheckable:false,
    rootVisible:true,
    bodyStyle:'background-color:#b4d5f5',
    containerScroll: true,
    loader: new Tree.TreeLoader({
        dataUrl:'rightAction!roleright.action',
        baseParams:{roleId:roleid},
        baseAttrs: { uiProvider: Ext.ux.TreeCheckNodeUI }
    })

});
var root = new Tree.AsyncTreeNode({
        text:"可用权限列表",
        draggable:false,
        id:'0'
    });

tree.setRootNode(root);
tree.render();
root.expand(true);

});
[/code]
firebug 显示的数据 firebug

[code="java"]
[{"id":1,"text":"校准计划","children":[{"id":2,"text":"2012","children":[],"pid":1,"leaf":true,"checked":false}],"pid":0,"leaf":false,"checked":false},{"id":3,"text":"校准台账","children":[{"id":4,"text":"aaa","children":[],"pid":3,"leaf":true,"checked":false}],"pid":0,"leaf":false,"checked":false}]
[/code]

1个回答

好久没用了,都不记得了。数据获取到的话,就不是问题了。我看你肯定有什么属性写错了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问