Changing an Icon based on what it is

I am using the loadXML property, to dynamically add items to my tree based on items in a database. I would like each level that loads to have an icon based on what that item is (instead of where it is in the tree).

In the code that creates the XML i know what type of item i am adding, but have not found a way to identify an image with that item.

any ideas?

You can set item’s images directly in the xml. It can be done using following attributes:

  • im0 - image for node without children (tree will get images from the path
    specified in setImagePath(url) method)
  • im1 - image for opened node with children
  • im2 - image for closed node with children

  • ...