I have JSON data and that JSON data has parent child relation . I Want to create tree structure from it. i found many plugins and libraries but i can't found my requirement . I am getting this JSON data using PHP script.
Here is image that has tree structure that i want to create . i'm stuck at it.I know JSON is not as displayed in image but i only want to show you what a tree should look like .How to create tree like in image.All i want is javascript code to handle and create this type of structure of tree . Working example is must & much appreciated.
You can use JSON format as you like and tree should be collapsible.Also provide required JSON format for it.
and my JSON data as follows :
{
2:
{
5: Wrist Watch
},
5:
{
9: Men's
},
18:
{
3: Clothing
},
28:
{
1: Perfumes
},
29:
{
7: Laptop,
10: Tablets
},
30:
{
8: Mobile
},
31:
{
2: Books
},
33:
{
6: Electronics
},
34:
{
4: Home & Kitchenn
}
}