【发布时间】:2020-03-02 14:56:27
【问题描述】:
我尝试通过 ajax 代理使用远程数据填充树列表,但树列表仅显示第一级并尝试重新加载子级别,即使 json 响应包含完整的树结构。小提琴链接:https://fiddle.sencha.com/#view/editor&fiddle/33u9
当我尝试扩展节点“SUB a”(或将扩展属性设置为 true)时,商店会尝试重新加载节点。
为什么不支持来自 json 响应的树结构?
提前致谢。
后端响应如下:
{
"data": {
"root": [
{
"leaf": true,
"text": "Server"
},
{
"leaf": true,
"text": "Storage"
},
{
"text": "SUB a"
"children": [
{
"leaf": true,
"text": "Modul A - 1"
},
{
"leaf": true,
"text": "Modul A - 2"
}
],
},
{
"leaf": true,
"text": "Modul B"
}
]
},
"success": true
}
使用的阅读器配置是
reader: {
type: 'json',
rootProperty: 'data.root',
successProperty: 'data.success',
},
【问题讨论】:
标签: extjs6