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

Other icon for parent with no children

1 Answer 19 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Wouter
Top achievements
Rank 1
Wouter asked on 06 Jan 2012, 04:10 PM
Hi,

How give a parent node an other icon than a plus or minus when it is having no children?
No my treeview is given no icon for items which having no children.

Regards,
Wouter Splinter

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 09 Jan 2012, 06:02 AM
Hello,

Try the following.
JS:
function OnClientLoad(sender, args)
{
   var nodes = sender.get_allNodes();
   for (var i = 0; i < nodes.length; i++)
   {
     if (nodes[i]._hasChildren() == false)
     {
        nodes[i].set_imageUrl("../Images/image1.gif");
     }
   }
}

Thanks,
Princy.
Tags
TreeView
Asked by
Wouter
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or