PDA

View Full Version : How can you convert nested data to a grouped list?



djkraz
13 Jan 2011, 5:24 AM
I am looking at using foursquare's api to return places information for reverse geolocation however they return data pre-grouped in the json and I would like to use those groups in a list. The problem is that the list object wants to group by a field in the record where as I need to group by the parent object.

Here is an example of the json returned by foursquare:


{
"groups":[
{
"type":"a",
"name":"Group 1",
"items": [
{"id":"1","name":"place1"},
{"id":"2","name":"place2"}
]
}, {
"type":"b",
"name":"Group 2",
"items": [
{"id":"1","name":"place1"},
{"id":"2","name":"place2"}
]
}
]
}


I guess you could look at it as wanting to display a TreeStore as a grouped List instead of a NestedList.

Any help on this would be GREATLY appreciated!