1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
    HumbleProgrammer is on a distinguished road

      0  

    Question Unanswered: Help with Nested List for JSON feed with no Specified Root

    Unanswered: Help with Nested List for JSON feed with no Specified Root


    Hello Everyone!

    I'm confused as to how to manipulate this data so that I can use it for a nested list. I don't have access to modify the JSON feed. The feed is as such:

    Code:
        "Cars": {
            "order": 1,
            "Brands": {
                "Hyundai": {
                    "model1": "Sonata",
                    "model2": "Elantra"
                },
                "Honda": {
                    "model1": "Accord",
                    "model2": "Civic"
                }
            }
        },
        
        "Trucks": {
            "order": 2,
            "Brands": {
                "Ford": {
                    "model1": "Ranger",
                    "model2": "F-150",
                    "website_url": "www.Ford.com"
                },
                "Jeep": {
                    "type1": "Compass"
                    "type2": "Liberty"
                    "website_url": "www.Jeep.com"
                }
            }
        },
        
        "Bicycles": {
            "order": 4,
            "Types":{
                "Mountain":{
                    "wheel grip": "great"
                },
                "Regular":{
                    "wheel grip": "good"
                }
            }
        }
    This is a feed that I just made which resembles exactlly how the json feed that I'm using is set up. As you can see there is no specified root. Also, "Brands" is the same with Cars and Trucks but not in Bicycles which is "Types". There is also the addition of "website_url" in Trucks which I want to use but is not under Cars. The set up for Bicycles is different but I want it part of the same list.

    Once again, this is a model of the actual feed and I would like "Cars, Trucks, and Bicycles" under the same nested list. I don't really know how to do this and I've been looking through the docs and through the forum for something like this with no luck. Thanks!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to have array of items not an object with multiple keys.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    5
    Vote Rating
    0
    HumbleProgrammer is on a distinguished road

      0  

    Default


    Thank you for replying. Is there any way to work around this? I mean is there a way to change the format of json file within Sencha? Is there is a work around or is modifying the actual json file the only feasible solution?

Thread Participants: 1

Tags for this Thread