In WebTreeView, you can perform add, edit and remove the WebTreeViewNode.
This topic will show you how to enable node editing using client-side events.
To add node in WebTreeView
- Go to WebTreeView's properties and set AllowAddNode to
True.
- You can add WebTreeViewNode in client side using
AddNode("Node's Name", "Node's Text) method.
- Implement onclick (button) client side event and add the following
code:
function Button1_onclick()
{
var treeView = ISGetObject("WebTreeView1");
treeView.AddNode("Node1", "BasketBall");
}
|
- To add a new node, select WebTreeViewNode (the path where the new node
will be placed) and then click the button.
To edit node in WebTreeView
- Go to WebTreeView's properties and set AllowNodeEditing to
Yes.
- You can edit the WebTreeViewNode by clicking twice to the WebTreeViewNode
or press F2.
To remove node in WebTreeView
- Go to WebTreeView's properties and set AllowDeleteNode to
True.
- You can delete the WebTreeViewNode by selecting the node that you
want to delete and press Delete button.
- You can also delete the WebTreeView node from client side
using DeleteNode(WebTreeViewNode) method.
- Implement onclick (button) client side event and add the following
code:
function Button1_onclick()
{
var treeView = ISGetObject("WebTreeView1");
//Get selected WebTreeViewNode
var node = treeView.GetSelectedNode();
treeView.DeleteNode(node);
}
|
- Run the project.