Check documentation for the latest version of dhtmlxSuite setItemIcons DHTMLX Docs


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


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


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