Intersoft Support Center

Update Node Text and Tooltip

WebTreeView provides a way for you to change the currently selected node's text and tooltip.

In this topic, you will learn how to implement the above scenario.

To change the current selected node's text and tooltip

  1. Bind WebTreeView to XMLDataSource.
  2. Drag 2 HTML TextBox and 1 HTML button controls to the WebForm.
  3. Set the button's caption to Update, TextBoxt ID to txtText and txtToolTip respectively.
  4. Use Set(“Text”, [text]) to change selected node's text and Set(“Tooltip”, [text]) to change selected node's tooltip.
  5. Implement onclick client side event for the button like following:

    JavaScript Copy ImageCopy Code
    function Update()
    {   
       var tv = ISGetObject("WebTreeView1");   
       var txtText = document.getElementById("txtText");   
       var txtToolTip = document.getElementById("txtToolTip");   
       var node = tv.GetSelectedNode();          
      
       if (node!=null)   
       {      
          if(txtText.value != "")         
             node.Set("Text", txtText.value);      
          if(txtToolTip.value != "")         
             node.Set("ToolTip", txtToolTip.value);   
       }   
       else      
          alert("Please select a node first !");
    }
                            
Previous Next