EXTJS中为什么得不到我后台的JSON数据 20
EXTJS代码如下:Ext.onReady(function(){Ext.BLANK_IMAGE_URL='../../ext/resources/images/defa...
EXTJS代码如下:
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '../../ext/resources/images/default/s.gif';
Ext.QuickTips.init();
alert("1111");
var loader=new Ext.Tree.TreeLoader({
dataUrl:"../../spring/nettree.data?action=queryNetinfo"
});
var tree=new Ext.tree.TreePanel({
el:'tree_div',
autoScroll:true,
animate:true,
enableDD:true,
containerScroll:true,
loader:loader
// root:root
});
var root=new Tree.AsyncTreeNode({
text:'',
draggable:false,
id:'-100'
});
tree.setRootNode(root);
tree.render();
root.expand();
});
各位大虾。求指点。。谢谢了 展开
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '../../ext/resources/images/default/s.gif';
Ext.QuickTips.init();
alert("1111");
var loader=new Ext.Tree.TreeLoader({
dataUrl:"../../spring/nettree.data?action=queryNetinfo"
});
var tree=new Ext.tree.TreePanel({
el:'tree_div',
autoScroll:true,
animate:true,
enableDD:true,
containerScroll:true,
loader:loader
// root:root
});
var root=new Tree.AsyncTreeNode({
text:'',
draggable:false,
id:'-100'
});
tree.setRootNode(root);
tree.render();
root.expand();
});
各位大虾。求指点。。谢谢了 展开
2个回答
展开全部
应该是用TreeStore来异步数据吧,发个例子给你:
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'FoundationManage.ashx'//这里写获取数据的地址
},
root: {//根节点的值和属性
text: '',
cls: "nodecls",
expanded: true,
parentId: 'parentId'
},
folderSort: true
});
Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody()
});
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'FoundationManage.ashx'//这里写获取数据的地址
},
root: {//根节点的值和属性
text: '',
cls: "nodecls",
expanded: true,
parentId: 'parentId'
},
folderSort: true
});
Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody()
});
2013-11-05
展开全部
你的后台有没有返回啊
this.write(response,jsonObject.toString());
this.write(response,jsonObject.toString());
追问
后台返回了啊。关键是连后台都没进去。
PrintWriter out = response.getWriter();
List list = nettreeBo.queryNetinfo();
JSONArray jo = JSONArray.fromObject(list);
out.write(jo.toString());
out.close();
这个是后台代码
追答
你后台都没进去,没查询数据,你的树当然显示不出来啊。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询