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
- Bind WebTreeView to XMLDataSource.
- Drag 2 HTML Buttons to the WebForm.
- Button1 will perform disabling WebTreeViewNode whereas
Button2 will perform enabling WebTreeViewMode with Set(“Enabled”, [enabled
value]) method.
- Implement onclick client side event for each button like following"
// 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);
}
|