Check documentation for the latest version of dhtmlxSuite setItemIcons DHTMLX Docs

setItemIcons

sets custom icons for an item

void setItemIcons(string|number id,object icons);
idstring|numberthe item's id
iconsobjectan object with custom icon/icons for the item

Example

myTreeView.setItemIcons(id, {
    file:           "icon_file",    // css for a file
    folder_opened:  "icon_opened",  // css for an opened folder
    folder_closed:  "icon_closed"   // css for a closed folder
});

Details

You also need to declare CSS rules for your custom icons, for example:

.icon_file {
    background-image: url(path/to/icon_file.png);
}
.icon_opened {
    background-image: url(path/to/icon_opened.png);
}
.icon_closed {
    background-image: url(path/to/icon_closed.png);
}
See also
Back to top