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
- Bind WebTreeView to XMLDataSource.
- Drag 2 HTML TextBox and 1 HTML button controls to the WebForm.
- Set the button's caption to Update, TextBoxt ID to
txtText and txtToolTip respectively.
- Use Set(“Text”, [text]) to change selected node's text and
Set(“Tooltip”, [text]) to change selected node's tooltip.
- Implement onclick client side event for the button like following:
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 !");
}
|