EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: gordis gmbh on February 16, 2017, 01:04:14 AM



Title: Tree events onSelect, onClick
Post by: gordis gmbh on February 16, 2017, 01:04:14 AM
Is it possible to fire tree's onSelect/onClick event only for new selection?

How can I ignore the onSelect event if the user selects the same node multiple times?


Title: Re: Tree events onSelect, onClick
Post by: stworthy on February 16, 2017, 01:17:28 AM
Returning false in 'onBeforeSelect' event will discard the selection on a node. Please try this code.
Code:
$('#tt').tree({
onBeforeSelect: function(node){
var selected = $(this).tree('getSelected');
if (selected && selected.target == node.target){
return false;
}
}
})


Title: Re: Tree events onSelect, onClick
Post by: gordis gmbh on February 16, 2017, 03:39:21 PM
Yes, that does the needful. Thanks very much for the timely support.