Intersoft Support Center

Enable Data Editing

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

  1. Go to WebTreeView's properties and set AllowAddNode to True.
  2. You can add WebTreeViewNode in client side using AddNode("Node's Name", "Node's Text) method.
  3. Implement onclick (button) client side event and add the following code:

    JavaScript Copy ImageCopy Code
    function Button1_onclick() 
    {
        var treeView = ISGetObject("WebTreeView1");
        treeView.AddNode("Node1", "BasketBall");
    }

  4. 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

  1. Go to WebTreeView's properties and set AllowNodeEditing to Yes.
  2. You can edit the WebTreeViewNode by clicking twice to the WebTreeViewNode or press F2.

To remove node in WebTreeView

  1. Go to WebTreeView's properties and set AllowDeleteNode to True.
  2. You can delete the WebTreeViewNode by selecting the node that you want to delete and press Delete button.
  3. You can also delete the WebTreeView node from client side using DeleteNode(WebTreeViewNode) method.
  4. Implement onclick (button) client side event and add the following code:

    JavaScript Copy ImageCopy Code
    function Button1_onclick() 
    {
       var treeView = ISGetObject("WebTreeView1");
       //Get selected WebTreeViewNode
       var node = treeView.GetSelectedNode();
       treeView.DeleteNode(node);
    }

  5. Run the project.
Previous Next