EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jlivio on August 07, 2015, 07:33:11 AM



Title: UI Tree
Post by: jlivio on August 07, 2015, 07:33:11 AM
Hi all

Is it possible to put an image in a NODE from a URL?

Thanks
JL


Title: Re: UI Tree
Post by: stworthy on August 07, 2015, 07:47:27 PM
You can use the 'formatter' function to render an <img> element on the node.
Code:
$('#tt').tree({
formatter:function(node){
var s = node.text;
if (node.text == 'Photos'){
s += '<img src="http://www.jeasyui.com/easyui/themes/icons/man.png"/>';
}
return s;
}
})