I have a question about tree component. Is it possible to make my tree component like a table ? Here is what i exactly want:
Here is some snippet from example of documentation:
nodes = [
{
id: 1,
name: "Санхүү",
children: [{ id: 2, name: "child1" }, { id: 3, name: "child2" }]
},
{
id: 4,
name: "Санхүүгийн бус",
children: [
{ id: 5, name: "Данс нээх харилцах" },
{
id: 6,
name: "Карт захиалах",
children: [{ id: 7, name: "subsub" }]
}
]
}
];
I think that the best aproach is create a table with the nodes. For this we use the variable "data" and a recursive function.
See that in "data" we has the nodes and a "level" to allow us to know in wich level are our node. If we has an .html like
When we make a click we call to the function
Really is an ugly example, but this stackblitz show the table