我想作为树呈现的JSON是
{
"productOfferings": [
{
"text": "Mobile subscription with Internet access 2GB and iPad 32GB",
"description": "Joors 2GB mobile broadband and iPad 32GB",
"productOfferings": [
{
"id": 5,
"text": "Ipad with 32 GB storage",
"description": "A iPad 32 GB Product Offering",
"productSpecification": {
"id": 5,
"text": "IPad",
"description": ""
}
},
{
"id": 8,
"text": "Mobile subscription with Sim Card and Internet access 2GB",
"description": "Mobile subscription with Sim Card and Internet access 2GB",
"productSpecification": {
"id": 9,
"text": "Mobile subscription with sim card and Internet access",
"description": "Mobile subscription with sim card and Internet access",
"productSpecifications": [
{
"id": 2,
"text": "Mobile subscription with Sim Card",
"description": "This is the classic Subscription product of a Mobile Network totally void of Services, so it can only be used for accessing a HPLMN. Simply put a MSISDN + SIM"
},
{
"id": 4,
"text": "Mobile Internet access",
"description": "This is a GPRS Service for a Mobile Network Access Product for accessing Internet"
}
]
}
}
]
}
]
}我想用extJS渲染一棵树,就像它在jsonviewer.stack.hu中使用json那样

我试着用小提琴做这件事,但却做不到,有几件事对小提琴很奇怪:
http://jsfiddle.net/niklasro/auBTH/24/
当我让根看不见的时候,它就变成了两个根。很奇怪。而且不能设置displayField,它必须有"text“的名称,但我不能仅仅因为extJS而更改json。我希望文本字段有名字" name“。我一直试图像produtSpecification一样渲染jsonviewer.stack,但是如何实现它是不可能的。你能帮帮我吗?
发布于 2013-10-25 12:53:49
作为第一个提示,ids在JSON:http://my.jetscreenshot.com/6795/20131025-xarw-24kb中必须是唯一的
https://stackoverflow.com/questions/19573186
复制相似问题