RadTreeNode text does not change after edit

4 posts, 0 answers
  1. Ben
    Ben avatar
    3 posts
    Member since:
    Apr 2008

    Posted 24 Jun 2009 Link to this post

    I have a RadTreeView that has nodes added on the client side. When I edit the text of one of the nodes I can see the new text in the text box, but after leaving edit mode it does not change the text of the node. In the OnClientNodeEdited event I can get the text that I have entered from the node. If I edit the node again, the text that I entered appears in the edit box. What could cause the node text to not change after editing?

    Here is my code that adds a node to the tree:

     

    var

     

    node = new Telerik.Web.UI.RadTreeNode();

     

     

    node.set_text(strName);

    node.set_imageUrl(docImgURL);

    node.set_contextMenuID(rcMenuDoc);

    node.set_allowDrag(

    false);

     

     

    tree.get_nodes().add(node);

     

    node.expand();

  2. Ben
    Ben avatar
    3 posts
    Member since:
    Apr 2008

    Posted 25 Jun 2009 Link to this post

    After looking at this problem further, I have found that the problem occurs when the initial name of the node has 2 or more spaces. For example, if I create a node with the text "red  blue" (2 spaces) and then edit it, the displayed text will not change.
  3. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 26 Jun 2009 Link to this post

    Hello Ben,

    We have already replied to your colleague:

    We logged the problem in our bug tracking system.

    In the meantime you can use the following workaround - copy this script after the treeview's declaration:


    <script type="text/javascript"
        Telerik.Web.UI.RadTreeNode.prototype._updateText = function(element, originalText, originalHtml, text) { 
            var encodedText = Telerik.Web.UI.RadTreeView._htmlEncode(text); 
            element.innerHTML = originalHtml.replace(originalHtml, encodedText); 
        } 
    </script> 



    Kind regards,
    Veselin Vasilev
    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.
  4. Ravi Sanker
    Ravi  Sanker avatar
    6 posts
    Member since:
    Jun 2009

    Posted 08 Jul 2009 Link to this post

    Hello Telerik,

    Did you fix this issue in your latest build? 

    I have downloaded the trial version one week back and faced same problem.

    If this issue is fixed, then we will buy the licensed version.


    Regards,
    itsvtk
Back to Top