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

node.set_text not working.

6 Answers 51 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Dale Palmer
Top achievements
Rank 1
Dale Palmer asked on 26 Jan 2009, 12:53 PM
            <telerik:RadTreeView ID="rtvQuickshop" 
                                 runat="server" 
                                 LoadingMessage="Loading ... " 
                                 CheckBoxes="true" 
                                 PersistLoadOnDemandNodes="false" 
                                 EnableViewState="false" 
                                 ShowLineImages="false" 
                                 EnableEmbeddedScripts="false" 
                                 OnNodeDataBound="rtvQuickshop_OnNodeDataBound" 
                                 OnClientNodeChecking="NodeChecking" 
                                 OnClientNodePopulating="NodePopulating" 
                                 Skin="Web20"
                <WebServiceSettings Path="~/QuickShop.asmx" Method="GetNodes" /> 
             
            </telerik:RadTreeView> 

I have the following RadTreeView and in the client NodeChecking event I have the following

function NodeChecking(sender, eventArgs) 
    var node = eventArgs.get_node(); 
    if(node.get_checked()) 
    { 
        node.set_text('<img src="/Images/Refreshing.gif" alt="Removing from basket, please wait..." class="qs_refresh" /> <span class="qs_normal">Removing from basket, please wait...</span>'); 
    } 
    else 
    { 
        node.set_text('<img src="/Images/Refreshing.gif" alt="Adding to basket, please wait..." class="qs_refresh" /> <span class="qs_normal">Adding to basket, please wait...</span>'); 
    } 

But node.set_text does not work??????????????????????????????????????

6 Answers, 1 is accepted

Sort by
0
Dale Palmer
Top achievements
Rank 1
answered on 26 Jan 2009, 01:00 PM
It stopped working when i switched to a web service.
0
Dale Palmer
Top achievements
Rank 1
answered on 26 Jan 2009, 01:16 PM
Fixed.

I used node.get_textElement().innerHTML = x;
0
McCarpenter
Top achievements
Rank 1
answered on 23 Apr 2010, 07:42 AM
node.get_textElement().innerHTML works fine - but if you write TreeView to xml on postback - with 

treeView.GetXml() method  - the resulting xml wouldn't be changed. My node contains "<img src='' ..." with text before image. 

0
Jose
Top achievements
Rank 1
answered on 20 Aug 2015, 06:02 PM

Is there a solution for this?

 I have the same problem...  When I remove a node, I update the removed node's parent text with set_text.  I get the JSON object before and after setting the text and the parent node's text changes in the JSON object, but doesn't get reflected in the tree...

 I tried parentNode.get_textElement().innerHTML without any luck...

0
Jose
Top achievements
Rank 1
answered on 20 Aug 2015, 06:35 PM

Just for future reference...

In my case, the issue was that I was using a client Template and calling set_clientTemplate at one point.  I guess the template has precedence over the text property.

0
Ivan Danchev
Telerik team
answered on 24 Aug 2015, 03:50 PM
Hello,

Thank you for sharing the source of the issue.

Regards,
Ivan Danchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TreeView
Asked by
Dale Palmer
Top achievements
Rank 1
Answers by
Dale Palmer
Top achievements
Rank 1
McCarpenter
Top achievements
Rank 1
Jose
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or