So, I am trying to figure out what the best way to get to this functionality would be now that I figured out how to get JQM and PhoneGap rendering the JSON objects in a listview. I want to:
- Parent: Display list of categories (e.g. "name": "Category A")
- Child: Each category displays a list of options (e.g. "name": "Example Item #A1")
- Single View: Clicking on an option pulls up a view with more details (e.g. now I show the "details" and the "active" values for the specific item that was clicked above)
The JSON is below (if I do it all in one request.. alternatively, I could do it so that each Category is its own request? the data file would never be amazingly huge)
So, how should I go about getting the JSON data and segmenting it? Do I need a local SQL server on the phone? Or can I do it all in the DOM? Any insights would be appreciated in what I should look into. Thanks!
- jsoncallback([
- {
- "active": true,
- "id": 5,
- "name": "Category A",
- "items": [
- {
- "active": true,
- "item_id": 24,
- "details": "Lorem Ipsum",
- "id": 149,
- "name": "Example Item #A1"
- },
- {
- "active": true,
- "item_id": 22,
- "details": "Not Available",
- "id": 150,
- "name": "Example Item #A2"
- }
- ]
- },
- {
- "active": true,
- "id": 4,
- "name": "Category B",
- "items": [
- {
- "active": true,
- "item_id": 21,
- "details": "Lorem Ipsum",
- "id": 151,
- "name": "Example Item #B1"
- },
- {
- "active": true,
- "item_id": 20,
- "details": "Not Available",
- "id": 152,
- "name": "Example Item #B2"
- },
- etc
- }
- ])