How can i get the root node and all parents and children to save to an API ?

1 Answer 310 Views
TreeView
Alex
Top achievements
Rank 1
Alex asked on 25 Feb 2022, 01:08 AM

I am trying to see if i can use tree view control in angular to allow my users to enable and move menu items.
Visually this seems to be not an issue but i am trying to figure out a way to sync the treeview data with my
backend end API. I use the NodeDrop event like this (nodeDrop)="handleDrop($event)" which gets me the start / orin position and where i droped it. But the problem is when i take a Node with some children and move it lets say all the way to top, the index of every Node will change but the only new index avail in the event is the destination index of where i dropped the node. In which case i would have to go and calculate all nodes new index but i hope there is a way to call a function which will provide a node module witch exposes all parents and child nodes and the current index.

 

 

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 01 Mar 2022, 10:48 AM

Hi Alex,

I see what the requirement is.

However, there isn't such an option that allows exposing the indexes of the TreeView nodes. I further see how such a feature would add value to the component thus I have created a new feature request, on your behalf, asking for this functionality in our public Feedback Portal:

https://feedback.telerik.com/kendo-angular-ui/1555773-expose-treeview-nodes-indexes

That will allow us to track the demand for this requirement and we will eventually add it to our future development plans.

I understand that calculating the indexes manually requires some additional custom effort, but at this point, there isn't a built-in feature that I can suggest.

Regards,
Svet
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TreeView
Asked by
Alex
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or