moveTreeViewItem
Definition
Package:@progress/kendo-vue-treeview
Moves a TreeView item without changing the original data. The function returns updated copies instead.
Parameters
sourceItemHierarchicalIndex string
The hierarchical index of the item that you move.
sourceData any[] | null | undefined
The tree that contains the item that you move.
operation "before" | "after" | "child"
The move operation.
The available options are:
before—The source item becomes the previous sibling of the target item.after—The source item becomes the next sibling of the target item.child—The source item becomes a child of the target item.
targetItemHierarchicalIndex string
The hierarchical index of the item next to which you move the source item.
targetData? any[] | null
The tree that contains the target item.
If you skip this argument, the function moves the item within the same tree.
You can also set sourceData and targetData to the same tree.
childrenField? string
The field that points to the sub-items of the data item. Defaults to items.
Returns
any[] | { sourceData: any[]; targetData: any[]; } - Updated copies of the sourceData and targetData arguments.
If you do not pass targetData, the function returns only the updated copy of sourceData.
any[] | { sourceData: any[]; targetData: any[] }