Intersoft Support Center

Enable/Disable Node

WebTreeView provides a way for you to enable and disable a WebTreeViewNode.

In this topic, you will learn how to enable and disable a WebTreeViewNode.

To enable and disable a WebTreeViewNode

  1. Bind WebTreeView to XMLDataSource.
  2. Drag 2 HTML Buttons to the WebForm.
  3. Button1 will perform disabling WebTreeViewNode whereas Button2 will perform enabling WebTreeViewMode with Set(“Enabled”, [enabled value]) method.
  4. Implement onclick client side event for each button like following"

    JavaScript Copy ImageCopy Code
    // Add this code to Button1 [Disable WebTreeViewNode]
    function Button1_onclick() 
    {   
       var treeView = ISGetObject("WebTreeView1");   
       var node = treeView.GetSelectedNode();
       
       if(node!=null)      
          node.Set("Enabled", false);}
    
    // Add this code to Button2 [Enable WebTreeViewNode]   
    function Button2_onclick() 
    {   
       var treeView = ISGetObject("WebTreeView1");   
       var node = treeView.GetSelectedNode();
       
       if(node!=null)      
          node.Set("Enabled", true);
    }
                            
Previous Next