How can i access the treeview Data in Kendo for Angular to walk the tree recursivly

636 Views Asked by At

I am wondering if anyone knows how to access the Kendo Angular TreeView Data ? I set up my treeview component like this and allow the user to make changes via drag and drop which fires off events like after add etc. The problem is that the event will have the new position of the dragged item but it doesnt have much info on what the new position is, if the item was drag out off like item was 0_1_2 and there was an item in 0_1_3 which should now move to 0_1_2. So what i am looking for is a dway to access the root node and then walk it down recursively and update my data object with new indexes.

This is how i setup my treeview component

<kendo-treeview
            [nodes]="data"
            textField="text"
            kendoTreeViewHierarchyBinding
            childrenField="items"
            [filterable]="true"
            kendoTreeViewExpandable
            [expandedKeys]="expandedKeys"
            [expandBy]="'text'"
            [kendoTreeViewCheckable]="checkableSettings"
            (checkedChange)="handleChecking($event)"
            [(checkedKeys)]="checkedKeys"
            checkBy="guid"
            kendoTreeViewDragAndDrop
            kendoTreeViewDragAndDropEditing
             (nodeDragStart)="log('nodeDragStart', $event)"
            (nodeDrag)="log('nodeDrag', $event)"
            (nodeDrop)="handleDrop($event)"
            (addItem)="log('addItem', $event)"
            (removeItem)="log('removeItem', $event)"
            (nodeDragEnd)="log('nodeDragEnd', $event)"
        >
        </kendo-treeview>
0

There are 0 best solutions below