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]