hummingbird-treeview
hummingbird-treeview copied to clipboard
Supporting JSON as data
Hi, Thanks for this amazing project. I wanted to know whether there is any feature by which we give the data as a JSON, it will create the treeview. For example:
{
"name":"tree_view",
"children":[ {
"name":"TS2:1",
"children":[ {
"name":"TS1:1",
"children":[ {
"name": "TS3:1", "children": []
}
,
{
"name":"TS4:2",
"children":[ {
"name": "TS6:2", "children": []
}
,
{
"name": "TS5:1", "children": []
}
]
}
]
}
]
}
]
}
One way I can do this is by writing JS to create 'ul' and 'li' elements by traversing this json. But it would be great if this can be added in the project itself.
Hi, Thanks for the ideas. Yes I absolutely agree that JSON input would be great. At the moment, I already have a converter from the "pseudo" list to real HTML. If you can include JS code for a JSON to HTML or via the "pseudo list" converter I would happily include it. At the moment I have no time, but I put it on my list.
Sure I can work on it. I will send the PR once it's done.