EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on July 16, 2015, 05:14:40 AM



Title: Tree - Right Click on Node Hover / Mouse-Over [Solved]
Post by: devnull on July 16, 2015, 05:14:40 AM
I need to be able to allow the user to right-click (context menu) during a hover over a tree node, even thought a different tree node is selected.

How can I do this ?



Title: Re: Tree - Right Click on Node Hover / Mouse-Over
Post by: jarry on July 16, 2015, 05:24:14 AM
Please try to bind the onContextMenu event.


Title: Re: Tree - Right Click on Node Hover / Mouse-Over
Post by: devnull on October 04, 2015, 06:06:47 PM
Hi;

This issue has just come up again, you cannot use the context menu, as the context menu will get the selected node which may not be the same as the hover node.

I need to allow the user to hover a menu, without selecting it, right click and then select and opetion from the context menu.

The problem is the node.id is the node id of the selected node and not the hover node !


Title: Re: Tree - Right Click on Node Hover / Mouse-Over
Post by: jarry on October 05, 2015, 01:32:29 AM
The 'onContextMenu' event gives you the hove node not the selected node. Please refer to the following code.
Code:
$('#tt').tree({
data: data,
onContextMenu: function(e, node){
e.preventDefault();
console.log(node.text)
}
})


Title: Re: Tree - Right Click on Node Hover / Mouse-Over
Post by: devnull on October 08, 2015, 08:44:46 PM
Yes, you are correct, thanks