EXT TREE

ch19851818 2014-08-29 09:09:05
求助:我用AJAX返回的数据如何加载给树?

Ext.Ajax.request( {
url : '',
method : 'POST',
params : {
'cardbosnum' : '11'
},
success : function(response, options) {
var resultArray = Ext.util.JSON.decode(response.responseText);
//alert(resultArray.jsonString);
if (resultArray) {

menudata1 = '['+resultArray.jsonString+']';
alert(menudata1);
accordion.setRootNode(root);
accordion.getRootNode().reload();
} else {
Ext.MessageBox.alert('操作提示', '数据异常,请联系管理员!');
}
},
failure : function(response, options) {
Ext.MessageBox.alert('操作提示', '网络异常,请重新登陆!');
}
});

我这样死活都加载不进去,不知道什么原因?拜求各位大侠 指导一下

返回的JSON "{"id":"001","cls":"forum..."渠道信息","children" : []}"
...全文
74 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ch19851818 2014-08-29
  • 打赏
  • 举报
回复
树的代码如下: var accordion = new Ext.tree.TreePanel( { id : 'forum-tree', region : 'west', xtype : 'treepanel', title : '首页', split : true, autoHeight : true, width : 225, collapsible : true, useArrows : true, autoScroll : true, animate : true, enableDD : true, containerScroll : true, rootVisible : false, // frame: true, margins : '0 0 5 5', lines : false }); var root = new Ext.tree.AsyncTreeNode( { text : 'Forums', expanded : true, children : menudata1 });

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧