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

Change Image/Class of Node without roundtrip

2 Answers 63 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
shahab
Top achievements
Rank 1
shahab asked on 25 Sep 2008, 10:26 AM
Hi could anyone please guide me in the direction of how I can implement the following:
I am replacing the image of the node  by using the following code. but for some reason I cannot get the image changed. The text of the node changes correctly but the image is not working.

//when the node is edites  
 
function OnNodeEdited(nodetext,imageurl)   
 
{  
 
var tree = $find("<%= tvwUserWorkout.ClientID %>");  
 
tree.trackChanges();  
 
for (var i = 0; i < tree.get_nodes().get_count(); i++) {  
 
var node = tree.get_nodes().getNode(i);  
 
node.set_imageUrl(imageurl);  
 
node.set_text(nodetext);  
 
 
}  
 
tree.commitChanges();  
 
}  
 

many thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 25 Sep 2008, 01:37 PM
Hello Shahab,

I tested the provided code and wasn't able to reproduce the issue you're facing. Please check the attached sample project for a reference. What is different in your case?

Regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
shahab
Top achievements
Rank 1
answered on 25 Sep 2008, 11:27 PM
It works perfectly now. many thanks again for your efficient support. have a great day.
Tags
TreeView
Asked by
shahab
Top achievements
Rank 1
Answers by
Yana
Telerik team
shahab
Top achievements
Rank 1
Share this question
or