Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need to add right click on node (Read 3035 times)
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Need to add right click on node
Oct 6th, 2012 at 10:19am
Print Post  
I m using javascript jdiagram I m able to generate click event on node by using following code

function nodeClicked(sender, args)
{   
     
      var node = args.getNode();
      var chld=getValues(node.getTag());
      alert(chld);
    if(node.getTag()!=null)
    {   
        ///code for event handling
    }

}

now i want to add right click event on node.What change i need to do in it?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to add right click on node
Reply #1 - Oct 6th, 2012 at 11:31am
Print Post  
The same event is raised for right clicks too, but you might have to disable the browser's context menu first:

Code
Select All
Sys.Application.add_load(function (sender, args)
{
	var diagram = $create(MindFusion.Diagramming.Diagram,
		null, null, null, $get("diagram"));

	diagram.addEventListener(Events.nodeClicked, onNodeClicked);
	diagram.get_element().oncontextmenu = function () { return false; }
}

function onNodeClicked(sender, args)
{
	// handle right-button click
	if (args.getMouseButton() == 2)
	....
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
anu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Location: Bhopal
Joined: Jan 27th, 2012
Re: Need to add right click on node
Reply #2 - Oct 17th, 2012 at 4:19am
Print Post  
Thanks Its Working
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint