This is a migrated thread and some comments may be shown as answers.

Get Node from DOM Elements

2 Answers 103 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
tom
Top achievements
Rank 1
tom asked on 19 Feb 2009, 10:22 PM
Can I retrieve a treeview node from the following DOM Element which is read from Treeview ?

<LI class="rtLI rtFirst" _itemTypeName="Telerik.Web.UI.RadTreeNode">
   <DIV class=rtTop jQuery1235081519640="2">
      <SPAN class=rtSp></SPAN>
      <SPAN class=rtPlus></SPAN>
         <IMG class=rtImg style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" alt="" src="Images/folder.gif" align=absMiddle>
      <SPAN class=rtIn jQuery1235081519640="3">xxx yyy zzz</SPAN> 
   </DIV>

I can get the node from tree.findNodeByText("xxx yyy zzz").
The problem is, the label/text "xxx yyy zzz" is not unique.
Is there a better way to uniquely identify that treeview node giving this piece of information?

Thanks. 
 

2 Answers, 1 is accepted

Sort by
0
tom
Top achievements
Rank 1
answered on 23 Feb 2009, 04:07 PM
Can anybody from Telerik helping me with this?




0
Atanas Korchev
Telerik team
answered on 23 Feb 2009, 04:13 PM
Hi tom,

findNodeByText returns the first node whose text matches the argument. If the text is not unique you can try assigning some unique value to your nodes and use the findNodeByValue method. There is no public API for getting a node from dom element.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
tom
Top achievements
Rank 1
Answers by
tom
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or