Wijmo Tree widget is used to present items in a hierarchical tree structure. It supports expand/collapse animations, stylish themes, and drag-and-drop functionality etc. The widget has a method called findNodeByText through which we can find a node by the specified node text. But, as of now, there is no method to search any node through its value. In this blog, we will see how we can select or delete any node in WijTree based on the unique value given to the li tags.
Create a WijTree
In order to create a WijTree, we'll use the following markup and script:
Selecting a Node
The basic concept of finding a node by value is to retrieve all li tags and then, filter them based on the value entered by the end user. Once we get the li tag then you can convert it in wijtreenode and can set it selected option to true.
Deleting a Node
For deleting the node, we first need to get its index and find whether its a child node or parent node. If it child node then find its parent and remove it. Else, we can directly use remove method of the WijTree and pass the node index. Here is the javascript:
Download the complete sample for the implementation.