а

Modify tree icon


#1

Hi, i’m new, and i’m here to post my question.
I want to change one tree icon, i’ve followed the instructions, but no way, attach here the code, the id “inviate” exists and also the fontawesome is included well.
Where is my mistake?
Thanks a lot.
var tree = new dhx.Tree(null, {isFolder: function(oggetto) {
var id = oggetto.id;
if(id.substr(0, 8)==“cartella” ) {
return true;
}else{
return false;
}

	}});
tree.data.load("treefolder/tree.php");
tree.data.update("inviate", {icon:"fab fa-accessible-icon"});

#2

Unfortunately it is not available to define an icon for one specific item.
The only possibility to customize the icons is to use the icon property:
https://docs.dhtmlx.com/suite/tree__api__tree_icon_config.html


#3

so the documentation is wrong?


#4

I apologize for the incorrect answer. for the item icon update you should use the following format:

tree.data.update(id,{icon:{
file:"fa fa-[iconname]",
openFolder:"fa fa-[iconname]",
folder:"fa fa-[iconname]"
}})