踩坑的小菜鸟 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 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接