4 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 03 Mar 2009, 01:09 PM
Hi Mehrdad,
Once you get the client-side object of RadTreeView, you can use findNodeByText() method to get the instance of a particular Node (if want to search by name). Try the following client side code for getting the node and selecting that.
JavaScript:
<script type="text/javascript"> |
function selectNode() |
{ |
var treeView = $find("<%= RadTreeView1.ClientID %>"); |
var node = treeView.findNodeByText("Node1"); |
node.select(); |
} |
</script> |
Thanks,
Princy.
0
Mehrdad
Top achievements
Rank 1
answered on 03 Mar 2009, 01:15 PM
Dear Princy, two other questions please:
1. where can I find menmers (methods and properties) of a RadControl (client and server side)
2. How can I do search by matching the menu text not exact, for example if I have a node with text: "Number", by enterig "umb" it be found? (i.e. while Cards)
1. where can I find menmers (methods and properties) of a RadControl (client and server side)
2. How can I do search by matching the menu text not exact, for example if I have a node with text: "Number", by enterig "umb" it be found? (i.e. while Cards)
0
Princy
Top achievements
Rank 2
answered on 04 Mar 2009, 06:26 AM
Hello Mehrdad,
I tried following client side code for searching and selecting node. Try the following code snippet and see whether its fit for your need.
JavaScript:
Checkout the following links.
Server-Side Events
Server-Side Programming Basics
Go through the link for most important functions of the RadTreeNode client side object and client side events.
RadTreeNode
Client-Side Events
Thanks,
Princy.
I tried following client side code for searching and selecting node. Try the following code snippet and see whether its fit for your need.
JavaScript:
<script type="text/javascript"> |
function searchNode() |
{ |
var treeView = $find("<%= RadTreeView1.ClientID %>"); |
var node = treeView.findNodeByText('Root'); |
search(node); //Call function by passing the root node |
} |
function search(node) |
{ |
var i; |
var str= node.get_text(); |
if(str.match("umb")!=null) //Compare with the search term |
{ |
node.select(); |
return; |
} |
else |
{ |
if(node._hasChildren()) |
{ |
for(i= 0; i<node._getChildren().get_count();i++) |
{ |
search(node._children._array[i]); |
} |
} |
else |
return; |
} |
} |
</script> |
Checkout the following links.
Server-Side Events
Server-Side Programming Basics
Go through the link for most important functions of the RadTreeNode client side object and client side events.
RadTreeNode
Client-Side Events
Thanks,
Princy.
0
Mehrdad
Top achievements
Rank 1
answered on 04 Mar 2009, 08:50 AM
A problem!
I have put the treeview in a usercontrol, and an object expected error occures in my code. it can't find a control with the name returned by $find(....
I have put the treeview in a usercontrol, and an object expected error occures in my code. it can't find a control with the name returned by $find(....