Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic AllowSelfLoops and DoubleClickedScript (Read 2188 times)
erPiu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Jun 20th, 2016
AllowSelfLoops and DoubleClickedScript
Jun 20th, 2016 at 9:02pm
Print Post  
Hi,

I'm using the ASP.NET pack 2014.R2, migrating a page from the java applet to javascript (canvas). Everything seems to be working with my diagram, except for self loops and the double-clicked script.

My page has the DiagramView object with

Diagram-AllowSelfLoops="false"
DoubleClickedScript="onDoubleClicked"


But it is allowing me to draw lines from one node to itself and the javascript function specified never gets fired.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: AllowSelfLoops and DoubleClickedScript
Reply #1 - Jun 21st, 2016 at 6:30am
Print Post  
Hi,

These aren't available yet in our JavaScript library, we'll try to implement them for next release. You could use LinkCreatingScript to prevent self-loops -

Code
Select All
function onLinkCreating(sender, args)
{
	var link = args.getLink();
	if (!link.targetConnection)
		return;

	var origin = link.getOrigin();
	var dest = link.targetConnection.node;

	args.setCancel(
		origin == dest);
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
erPiu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Jun 20th, 2016
Re: AllowSelfLoops and DoubleClickedScript
Reply #2 - Jun 21st, 2016 at 8:02pm
Print Post  
Great! Tks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint