capture node text and level through javascript

2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Oct 2008

    Posted 27 Oct 2008 Link to this post

    Hello all. I am trying to find a way, if possible, to capture the checked node's text through javascript when the node is checked. Also I would like to be able to capture the text of the children or parent nodes to the checked node if possible. Is there anyway to get this to function through javascript? Any help would be much appreciated.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Oct 2008 Link to this post


    1.Try the following code snippet to access the cheked node text.

    <telerik:RadTreeView ID="RadTreeView1"  runat="server"  CheckBoxes="true" OnClientNodeChecked="OnClientNodeChecked" > 

    <script type="text/javascript" language="javascript" > 
       function OnClientNodeChecked(sender, eventArgs ) 
          var node = eventArgs.get_node();  
          var nodetxt=node.get_textElement().innerHTML; 

    2. Code snippet to get checked node's Parent node text.

    function OnClientNodeChecked(sender, eventArgs ) 
     var node = eventArgs.get_node();  
     var nodetxt= node.get_parent().get_textElement().innerHTML; 

Back to Top