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

Setting a node's image on select

3 Answers 107 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Eric-Paul
Top achievements
Rank 1
Eric-Paul asked on 17 Jan 2013, 03:40 PM
Having a treeview with images for each node, I tried changing the image for the node upon selection using the following event handler:
function onSelectNode( e )
{
    var dataItem = this.dataItem( e.node );
    dataItem.imageUrl = "someImage.png";
]
While stepping it appears that dataItem.imageUrl has been changed, however the treeview does not show the new image.
How can I get the new image to show?

3 Answers, 1 is accepted

Sort by
1
Alex Gyoshev
Telerik team
answered on 18 Jan 2013, 11:25 AM
Hello Eric,

Use the set method of the dataItem:

dataItem.set("imageUrl", "someImage.png");

The above code may require an upgrade to the Q1 service pack in order to function properly.

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Andrea
Top achievements
Rank 1
Iron
commented on 14 Apr 2022, 01:52 PM | edited

My code example:
noCustomDataItem.set("imageUrl", "/Administration/Content/images/active-true.gif");
Work!
0
Eric-Paul
Top achievements
Rank 1
answered on 21 Jan 2013, 09:30 AM
Hello Alex,

Installed the Q1 service pack and it works like a charm.

Thanks!!

Regards, Eric-Paul
0
Andrea
Top achievements
Rank 1
Iron
answered on 14 Apr 2022, 01:52 PM
Just added the set method and worked perfectly!
Thank you so much!
Tags
TreeView
Asked by
Eric-Paul
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Eric-Paul
Top achievements
Rank 1
Andrea
Top achievements
Rank 1
Iron
Share this question
or