-
20 Mar 2012 7:08 AM #1
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:
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.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" } } }
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!
-
20 Mar 2012 7:26 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3155
You need to have array of items not an object with multiple keys.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Mar 2012 7:41 AM #3
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?


Reply With Quote