Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Restrict drawing links between children inside a container (Read 2317 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Restrict drawing links between children inside a container
May 3rd, 2013 at 11:28am
Print Post  
Hi,

I have a container node which is having some children. I need to restrict drawing links between these children. How can i achieve this? I should be able to draw links between the children of 2 containers.

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restrict drawing links between children inside a container
Reply #1 - May 3rd, 2013 at 2:32pm
Print Post  
Hi,

Try this if you want to allow links only between children of same container:

Code
Select All
function onLinkCreating(sender, args)
{
	var link = args.getLink();
	var origin = link.getOrigin();
	if (link.targetConnection)
	{
		var dest = link.targetConnection.node;
		if (origin.container != dest.container)
			args.setCancel(true);
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint