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

Icon for nodes that does not have a children

1 Answer 20 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
thomson
Top achievements
Rank 1
thomson asked on 14 Mar 2014, 01:16 PM
Hi,
         In the treeview we have nodes that has child elements not visible , For this we add icon using rtPlus and rtMinus class. On the same treeview we have nodes that does not have any child.We need to place an icon . How do i target these nodes in CSS?


1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Mar 2014, 09:32 AM
Hi thomson,

Please try the following JavaScript to add an icon to the RadTreeNode which doesn't have any child.

JavaScript:
function pageLoad() {
    var tree = $find("<%=RadTreeView1.ClientID %>");
    for (i = 0; i < tree.get_allNodes().length; i++) {
        if (tree.get_allNodes()[i]._hasChildren() == false) {
            tree.get_allNodes()[i].set_imageUrl("delete-icon.png");//set the icon url here
        }
    }
}

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