在学习conbotree组件时,当点击一个加载json时出现undefined。
具体情况如下:
.json文件如下
[
{
"id" : 1,
"text" : "系统管理",
"iconCls" : "icon-save",
"children" : [
{
"text" : "主机信息",
"state" : "closed",
"children" : [
{
"text" : "版本信息"
},
{
"text" : "数据库信息"
}
]
},
{
"text" : "更新管理"
},
{
"id" : 5,
"text" : "程序管理"
}
]
},
{
"id" : 2,
"text" : "会员管理",
"children" : [
{
"id" : 7,
"text" : "新增会员",
"checked" : true
},
{
"id" : 6,
"text" : "审核会员"
}
]
}
]
。开启服务器,访问这个jsp页面,如图:
点击“更新管理”,出现如图:
解决方法:在json中“更新管理”的上面加上“id” : XXXX,即可解决这个问题。