How unselect Item on click out from the tree

Hi,

I would like to know how can I unselect an item when I click outside from the item selected, is it possible ?

Currently I use the method :
$(“#myTreeContainer”).click(function(){
//code which permit to unselect the node
});

The problem is that this method “click” is called on each click in the tree, even when an item is clicked.

Is there an easy way to solve this issue ?

Thanks.

Try the following approach to

[code]var itemClick = false;
tree.attachEvent(“onClick”,function(id){
itemClick = true;
window.setTimeout(function(){
itemClick = false;
},1);
});

document.body.onclick = function(){
if(!itemClick)
tree.clearSelection();
})[/code]

thanks it work’s fine