ASP.NET 3.5 and above only

ASP.NET TreeView -Client Object Model

Getting OboutTree Client Object

The OboutTree control is an ASP.NET AJAX Server control and the client-side object can be get as shown below,


<script type="text/javascript">
    function pageLoad(sender,args){
        var obTree1=$find("<%=OboutTree1.ClientID%>");
    } 
</script>  
<obout:Tree ID="OboutTree1" runat="server" >
</obout:Tree>          
            

Methods

Name Description
expand Expands the node.
Arguments: (object node)
Returns: void

//Get the node object by id
var node=obTree1.getNode('a1');
//Expand the node
obTree1.expand(node);
                    
collapse Collapse the node.
Arguments: (object node)
Returns: void

//Get the node object by id
var node=obTree1.getNode('a1');
//Collapse the node
obTree1.collapse(node);
                    
getNode Get the actual node object by Id
Arguments: (string id)
Returns: object

//Get the node object by id
var node=obTree1.getNode('a1');
                    
getNodeByIndex Get the node by node index
Arguments: (string index)
Returns: object

//Get the node object by index. 
//This index denotes the node 'Node3',
// Node1(index-0)
//      Node2(index-0)
//          Node3(index-0)        
var node=obTree1.getNodeByIndex('0:0:0');
//Expand the node
obTree1.expand(node);
                    
getNodeIndex Get the index of the node
Arguments: (object node)
Returns: string

//Get the node object by id
var node=obTree1.getNode('a1');
var index=obTree1.getNodeIndex(node);
                    
getNodeText Get the text of the node
Arguments: (object node)
Returns: string

//Get the node text
var text=obTree1.getNodeText(node1);
                    
setNodeText Set the text of a node
Arguments: (object node,string value)
Returns: null

//Set the node text
obTree1.setNodeText(node1,'Modified value');
                    
getNodeType Get the type of the node.
Arguments: (object node)
Returns: NodeType

//Get the node object by id
var node=obTree1.getNode('a1');
//Get type of the node. 
//Types of node:
//NodeType = {
//    Node: 0,
//    RootNode: 1,
//    Leaf: 3
//}
var type=obTree1.getNodeType(node);
                    
getNodeValue Get the value of the node.
Arguments: (object node)
Returns: object
[C#]

Node node=new Node();
node.Text="Node1";
node.Value="Value1";
                    
[Javascript]

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getNodeValue(node)
                    
getParentNode Get the parent of the node.
Arguments: (object node)
Returns: object

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getParentNode(node)
                    
hasChildNode Get the value indicating whether the node has child nodes.
Arguments: (object node)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.hasChildNode(node)
                    
isDragDisabled Get the value indicating whether the node is disabled to drag
Arguments: (object node)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.isDragDisabled(node)
                    
isDropDisabled Get the value indicating whether the node is disabled to drop
Arguments: (object node)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.isDropDisabled(node)
                    
isEditDisabled Get the value indicating whether the node is disabled to edit
Arguments: (object node)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.isEditDisabled(node)
                    
isExpanded Get the value indicating whether the node is expanded
Arguments: (object node)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.isExpanded(node)
                    
isNode Get the value indicating whether the element is a node
Arguments: (string id)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.isNode(node)
                    
isSelected Get the value indicating whether the node is selected
Arguments: (object node)
Returns: bool

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.isSelected(node)
                    
getChildNodes Get the child nodes of a node
Arguments: (object node)
Returns: Array of nodes

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getChildNodes(node)
                    
getFirstChild Get the first child node of a node
Arguments: (object node)
Returns: node

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getFirstChild(node)
                    
getLastChild Get the last child node of a node
Arguments: (object node)
Returns: node

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getLastChild(node)
                    
getNextSiblingNode Get the next sibling node of a node
Arguments: (object node)
Returns: node

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getNextSiblingNode(node)
                    
getPreviousSiblingNode Get the previous sibling node of a node
Arguments: (object node)
Returns: node

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getPreviousSiblingNode(node)
                    
getPreviousVisibleNode Get the previous visible node of a node
Arguments: (object node)
Returns: node

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getPreviousVisibleNode(node)
                    
getNextVisibleNode Get the next visible node of a node
Arguments: (object node)
Returns: node

//Get the node object by id
var node=obTree1.getNode('a1');
var value=obTree1.getNextVisibleNode(node)
                    
setHovered Set hovered node style to a node
Arguments: (object node)
Returns: void

//Get the node object by id
var node=obTree1.getNode('a1');
obTree1.setHovered(node)
                    
setHoveredOut Set hovered out node style to a node
Arguments: (object node)
Returns: void

//Get the node object by id
var node=obTree1.getNode('a1');
obTree1.setHoveredOut(node)
                    
unselectNode un select a node
Arguments: (object node)
Returns: void

//Get the node object by id
var node=obTree1.getNode('a1');
obTree1.unselectNode(node)
                    
getSelectedNodes get the list of selected nodes
Arguments: null
Returns: Array

//Get the node object by id
var nodes=obTree1.getSelectedNodes();
                    
setSelected Set a node as selected
Arguments: object node,bool isMultiple
Returns: Array

//This will clear all the selected nodes
// and then select the target node
obTree1.setSelected(node);
//This will not clear the previously selected node.
// it just appends the target node in the selected node list.
obTree1.setSelected(node,true);
                    
clearSelection clears all the selected nodes.
Arguments: null
Returns: void

obTree1.clearSelection();
                    

"I use the obout suite for a great deal of highly complex application work and it has proven itself to be very reliable."

Dr. Daniel Donnelly
Bliss-Systems Ltd

Random testimonial   All testimonials