Going through JSON

1

I have a little difficulty performing a function. I wonder if you can help me?

Well, I need to do a navigation via click and each level is stored in a json. A structure similar to the one below:

{  
   [  
      {  
         "id":"2",
         "atividade":"Andou",
         "children":[  
            {  
               "id":"3",
               "atividade":"Muito",
               "children":[
                    {
                        "id":"4",
                        "atividade":"Final",
                        "children":[

                        ]
                    }
               ]
            }
         ]
      },
      {  
         "id":"5",
         "atividade":"Voltou",
         "children":[  
            {  
               "id":"6",
               "atividade":"Muito",
               "children":[  

               ]
            }
         ]
      }
   ]
}

So I made a for that takes the first two levels of json, ie, walked and returned and plays on the screen with their respective id and index.

What I'm not able to do is to navigate, that is, click on walked and follow the next item and when I click on the next one go to another item and so on. Also I need to do the function that make it go back, ie go back through json.

Can anyone help me?

Thank you!

    
asked by anonymous 01.08.2015 / 03:01

0 answers