xx125556
2011-09-05 00:27
浏览 379
已采纳

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条回答 默认 最新

  • kxys422834 2011-09-05 09:10
    已采纳

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

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题