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

RadTreeNode text does not change after edit

3 Answers 136 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 24 Jun 2009, 03:04 PM
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();

3 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 25 Jun 2009, 02:35 PM
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.
0
Veselin Vasilev
Telerik team
answered on 26 Jun 2009, 08:03 AM
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.
0
Ravi Sanker
Top achievements
Rank 1
answered on 08 Jul 2009, 02:59 PM
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
Tags
TreeView
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Ravi Sanker
Top achievements
Rank 1
Share this question
or