Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to restrict a container node getting added to another container node (Read 2817 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
How to restrict a container node getting added to another container node
Apr 22nd, 2013 at 6:48pm
Print Post  
Hi,

I want to restrict a container node getting added to another container node.
I want to restrict in below 2 scenarios.

1. While dragging and adding to a container node.
2. While re-sizing a container node and overlapping to another container node.

How can i achieve this?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to restrict a container node getting added to another container node
Reply #1 - Apr 23rd, 2013 at 10:14am
Print Post  
Hi,

Try this:

Code
Select All
var ContainerNode = MindFusion.Diagramming.ContainerNode;

function onNodeModifying(sender, args)
{
	if (ContainerNode.isInstanceOfType(args.getNode()))
	{
		var nodes = sender.getNodesAt(args.getMousePosition());
		Array.forEach(nodes, function (node)
		{
			if (node != args.getNode() &&
				ContainerNode.isInstanceOfType(node))
			{
				args.setCancel(true);
			}
		});
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Re: How to restrict a container node getting added to another container node
Reply #2 - Apr 23rd, 2013 at 1:01pm
Print Post  
Thanks Stoyan,

Its working for me!!!!!

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint