The 'formatter' function only render the node's text. Please try to use the 'loadFilter' function to change the node's icon.
$('#tt').tree({
loadFilter: function(data, parent){
function forNodes(data, callback){
var nodes = [];
for(var i=0; i<data.length; i++){
nodes.push(data[i]);
}
while(nodes.length){
var node = nodes.shift();
if (callback(node) == false){return;}
if (node.children){
for(var i=node.children.length-1; i>=0; i--){
nodes.unshift(node.children[i]);
}
}
}
}
forNodes(data, function(node){
if (node.id == 'x'){
node.iconCls = 'icon-user';
}
});
return data;
}
})