Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cancel link created event (Read 1418 times)
Gagandeep Singh
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
Cancel link created event
May 1st, 2023 at 7:10pm
Print Post  
Hi there,

I am trying to cancel the operation when we create a link, how can I do this?

Code (Javascript)
Select All
diagram.addEventListener(Events.linkCreated, (sender, args) => {
		if(sourceAndDestinationNodeAreNotSame) {
			//I want to cancel the operation
		}

}); 

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Cancel link created event
Reply #1 - May 1st, 2023 at 8:01pm
Print Post  
Hi,

Handle linkCreating validation event instead, and set args.cancel = true if conditions not met.

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


I Love MindFusion!

Posts: 11
Joined: Dec 1st, 2022
Re: Cancel link created event
Reply #2 - May 2nd, 2023 at 12:52pm
Print Post  
Perfect it works thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint