#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    29
    Rep Power
    0

    Recursion with JSON


    Hi to all.I have a JSON that i paste. What i have to do is, take the path of every child with recursion. In ExtJS comboBox i have to put the every child of the JSON. And when i select one, the path way is has to show below.
    My problem is with RECURSION.

    http://pastebin.com/Hd8cg1kp
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0
    Can you describe your problem more detail? Or show some code
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    29
    Rep Power
    0
    http://pastebin.com/edit.php?i=XxBKkY81 here is solution without combobox but with correct recursion.


    http://pastebin.com/edit.php?i=6wTu6b8Q here is solution with correct combobox but without recursion.

    I have to combine them. With recursion like first code and with combobox like mine, second code.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    26
    Rep Power
    0
    something like this ...

    codingforums.daveyerwin.com/val10/
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    22
    Rep Power
    0
    First I am posting any solution because I don't understand the asked problem.

    But I just want to point out that you are using the word "RECURSION" incorrectly in term of programming. This is not recursion but it is more like "NESTED" JSON DATA.

    Although there is nothing to block you from building a JSON like you have but as for programming convention, it is not good idea to have same node name in nested data as a parent node. Such as "children" node name you kept using in your JSON.

IMN logo majestic logo threadwatch logo seochat tools logo