Get Node from DOM Elements

3 posts, 0 answers
  1. tom
    tom avatar
    19 posts
    Member since:
    Dec 2008

    Posted 19 Feb 2009 Link to this post

    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. tom
    tom avatar
    19 posts
    Member since:
    Dec 2008

    Posted 23 Feb 2009 Link to this post

    Can anybody from Telerik helping me with this?




  3. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 23 Feb 2009 Link to this post

    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.
Back to Top