EasyUI Forum
July 05, 2024, 01:25:21 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tree - Right Click on Node Hover / Mouse-Over [Solved]  (Read 7384 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« 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 ?

« Last Edit: October 08, 2015, 08:44:59 PM by devnull » Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2269


View Profile Email
« Reply #1 on: July 16, 2015, 05:24:14 AM »

Please try to bind the onContextMenu event.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 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 !
Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2269


View Profile Email
« Reply #3 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)
}
})
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #4 on: October 08, 2015, 08:44:46 PM »

Yes, you are correct, thanks
Logged

-- Licensed User --
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!