Flat Datasource Suggestion
I want to suggest a new type of datasource. Currently, we need to iterate the data to apply the children and grand children and so on: like this:
node0
node1
node2
node21
node22
Im suggesting to have a json data like this:
[{id: 1, name: 'node0', parent: null},
{id: 2, name: 'node1', parent: 1},
{id: 3, name: 'node2', parent: 2},
{id: 4, name: 'node21', parent: 3},
{id: 5, name: 'node22', parent: 3}]
it is easier to build this json data when you retrieve it from the database because its flat. also, we can also implement data pagination. say I want to show the first 100 items and scroll-down to load another 100 items.
what do you think?
this jquery plugin support the datasource im taking about. https://www.jstree.com/docs/json/
I also require this flat JSON structure, however the following link helped me in converting to a structured JSON https://stackoverflow.com/questions/47182928/converting-flat-json-to-parent-child-relational-structure