踩坑的小菜鸟 2017-07-05 07:37 采纳率: 50%
浏览 1092

ExtJs动态加载二级树无限循环怎么办?

如题,下面是我返回的JSon:
{
"bugs": [
{
"id": 1,
"text": "用户管理",
"leaf": false,
"children": [
{
"id": 7,
"text": "修改用户",
"leaf": true,
"attributes": {
"url": "UserManager.html"
}
},
{
"id": 8,
"text": "添加用户",
"leaf": true,
"attributes": {
"url": "UserManager.html"
}
},
{
"id": 9,
"text": "删除用户",
"leaf": true,
"attributes": {
"url": "UserManager.html"
}
}
]
},
{
"id": 2,
"text": "职务管理",
"leaf": false,
"children": [
{
"id": 10,
"text": "修改职务",
"leaf": true,
"attributes": {
"url": "DepartManager.html"
}
},
{
"id": 11,
"text": "添加职务",
"leaf": true,
"attributes": {
"url": "DepartManager.html"
}
},
{
"id": 12,
"text": "删除职务",
"leaf": true,
"attributes": {
"url": "DepartManager.html"
}
}
]
},
{
"id": 6,
"text": "商品管理",
"leaf": false,
"children": [
{
"id": 3,
"text": "商品出库审批",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
},
{
"id": 4,
"text": "商品入库审批",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
},
{
"id": 13,
"text": "添加商品入库",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
},
{
"id": 14,
"text": "商品入库审批",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
},
{
"id": 15,
"text": "添加商品出库",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
},
{
"id": 16,
"text": "商品出库审批",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
}
]
},
{
"id": 17,
"text": "授权管理",
"leaf": false,
"children": [
{
"id": 22,
"text": "授权",
"leaf": true,
"attributes": {
"url": "GoodsManager.html"
}
}
]
}
]
}
这是我的页面:
Ext.onReady(function () {
var tree_store = Ext.create('Ext.data.TreeStore', {
id: 'tree_store',
proxy: {
type: 'ajax',
url: 'Home/TreeDate',
reader: {
type: 'json',
root: 'bugs'
}
},
root: {
text: '部门',
expanded:true
},
autoLoad:true
});
var left = Ext.create('Ext.tree.Panel', {
renderTo:Ext.getBody(),
title: "菜单",
width: 200,
store: tree_store,
border: true
})
})

  • 写回答

1条回答

  • 踩坑的小菜鸟 2017-07-05 07:45
    关注

    图片说明 补充问题页面是这样的

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作