首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的小提琴不正确?

为什么我的小提琴不正确?
EN

Stack Overflow用户
提问于 2013-10-24 18:00:13
回答 1查看 86关注 0票数 1

我想作为树呈现的JSON是

代码语言:javascript
复制
{
    "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,但是如何实现它是不可能的。你能帮帮我吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-25 12:53:49

作为第一个提示,ids在JSON:http://my.jetscreenshot.com/6795/20131025-xarw-24kb中必须是唯一的

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19573186

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档