When clicking a tree node, the 'onClick' event fires, in which you can call 'expand','collapse' or 'toggle' methods to do actions on this clicked node. Please try the code below:
$('#tt').tree({
data:data,
onClick:function(node){
$(this).tree('toggle', node.target);
}
})