how to set item icon between diffrent levels


#1

hi.i’ve encounted this problem:

i need to hide the folder of items which are not the leaf ones.just reverve the"plus"icon.and set special icon for leaf items.what should i do?

tree.enableTreeLines(false);
tree.setImagePath("/phase2/images/imgs/");
tree.enableCheckBoxes(false);

i want to set "blank.gif"for the leaf item.


#2

Hi
You need the next:

var count = tree.hasChildren(itemId); if (count == 0){ tree.setItemImage(itemId,image1,image2); }


#3

thank u :slight_smile: .surely it works.


#4

Hi,

Where I need to use this code?


#5

Hi,

after tree data loading and apply the parameters you need (instead of itemId, image1 and image2)