PDA

View Full Version : Grouped List to Full Description on Click Example



garkelly
19 Sep 2011, 1:20 AM
Hi,
Playing around with Sencha touch over the last week. Slowly getting to grips with it I think. One thing I have been trying to do avail though. I have tried to find a code example but do joy.

What I am trying to do is read in a JSON file where I have items grouped by item type. I would like to display a list of items under item type with the item type styled differently (like the letters A-Z in a contact list). And if I click on an item, slide to show a panel with a HTML Layout (I will use JSON data for the selected item).

For example, my JSON would look like this:


{
"Dogs": [
{
"type": "Dalmation",
"pic": "dalmation.jpg",
"age": "4"

},
{
"type": "Labrador",
"pic": "lab.jpg",
"age": "3"
},
{
"type": "Beagle",
"pic": "beagle.jpg",
"age": "1"
}
],


"Birds": [
{
"type": "Budgie",
"pic": "budgie.jpg",
"age": "1"
},
{
"type": "Parrot",
"pic": "parrot.jpg",
"age": "1"
}
]

}


So my list would look like:

DOGS
Dalmation
Labrador
Beagle
BIRDS
Budgie
Parrot

and if I click on dalmation I could see more info on dalmation (Pic, Age) with a back button to list.

I would have thought this has been done a few times before.
Can someone point me to an example?

garkelly
19 Sep 2011, 5:48 AM
Found someone else trying to do the same thing.
http://www.sencha.com/forum/showthread.php?143659-Problem-with-grouped-association-JSON-list
but I am getting the same error he is.