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

set_imageUrl problems

2 Answers 69 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Dwight
Top achievements
Rank 1
Dwight asked on 05 Sep 2008, 02:59 PM
Hi all,$0$0$0$0I have been trying to get this to work with little success.$0$0$0$0$0I am using the following JavaScript code to change the icon for a specific node when the state of that node has been changed on the server. $0$0$0$0$0$0 <script type="text/javascript" language="javascript">$0$0 function SetNode(guid, img)$0$0 {$0$0 var treeControl = $find(treeControlID);$0$0$0 var node = treeControl.findNodeByValue(guid);$0$0$0 node.set_imageUrl = img;$0$0 }$0$0$0 </script>$0$0$0$0$0This script runs but the icon for the node does not change.$0$0$0$0$0I have debugged this and found out that node.set_imageUrl = img just creates a new attribute to the node element called set_imageUrl with the value of the img variable and does not actually call the method.$0$0$0$0$0Is there something I am doing wrong here?$0$0$0$0$0Thanks,$0$0$0$0$0Dwight$0$0

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 05 Sep 2008, 03:04 PM
Hello Dwight,

You need to use the set_imageUrl method in this way:

node.set_imageUrl(img); 

I hope this helps.

Greetings,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Dwight
Top achievements
Rank 1
answered on 05 Sep 2008, 03:35 PM
Ahh of course thanks.
Tags
TreeView
Asked by
Dwight
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Dwight
Top achievements
Rank 1
Share this question
or