How can we change the Tree Leaf Icon, when the Leaf is clicked. Only for the clicked Node/Leaf

I have tried the below mentioned code snippet(which i got from some thread) change the image icon for tree node leaf but still the image is not changing .....plzzzz help me out of this i have tried lot of options...

function(sm, node){
}, this, true);