Hi Hosney,
Greetings from Syncfusion support.
We have checked your reported problem with TreeView component. Currently, we have not provided support for moving the nodes to root level of TreeView component. Based on your request, we have considered it as a feature request. Support for this feature will be included in any one of our upcoming releases. Generally, we will plan any feature implementation based on customer request count, feature rank and wishlist plan for some feature.
Please, track the following feedback link to know the status of this feature implementation.
However, we suggest you to use the removeNodes and addNodes method to achieve your requirement.
document.getElementById("move").onclick = () => {
// get the node details.
var node_data = treeObj.getNode("2");
let obj: any = { name: node_data.text, id: node_data.id };
//remove the nodes using remove nodes method.
treeObj.removeNodes(["2"]);
//add the nodes using addNodes method.
treeObj.addNodes([obj], null);
}; |
Please, refer to the below link for more details on TreeView component.
Please let us know, if you need any further assistance.
Regards,
Sowmiya.P