我有一个响应 JSON 字符串的 HTTP 服务器。它们看起来像这样:
{
...
“价值”:{
“孩子们”:[
{
"路径":"KEY_518693",
"名称":"KEY_518693",
"children_count_overall":0,
"children_page":1,
“children_pages”:1,
“children_pagesize”:10
...
}
],
"children_count_overall":1,
"children_page":1,
“children_pages”:1,
"children_pagesize":1,
“名称”:空,
“路径”:空,
...
}
}
每个请求都有父节点(in "value"),我为此请求了子节点和这个子节点(in "children"),还有一些分页信息。
如果未指定父节点,则将根节点作为虚拟根节点的子节点返回。
我将"root"代理的属性设置为"value",因此代理知道在哪里搜索节点,但是tree我的 TreeStore 的成员在 a 之后有一个奇怪的结构load():
tree: {
childNodes: [
{
childNodes: [], <-- no child?
data: {
children: [
{ ...the raw data of the "children" node (like in the example above)...}
],
... the data of the "value" node and some data from the implicit node model...
}
}
]
}
不知何故,对象"value"被转换为节点并插入到树中,但"children"数组中的对象不会被转换并最终成为该"value"节点的数据。