Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can we handle click Up and click down in custom node? (Read 1678 times)
Shafi
Full Member
***
Offline


I Love MindFusion!

Posts: 109
Joined: Nov 8th, 2016
Can we handle click Up and click down in custom node?
Jan 17th, 2018 at 9:14am
Print Post  
Hi

Can we handle two different events click up/down event for custom node? As I can find any event in library.

If your answer is no then please let me know how can we handle click and double event for same diagram for click event we are using below code.

Code (Javascript)
Select All
        this.diagram.addEventListener(Events.nodeClicked, (sender, args) => {
            const destinationVO = args.link.destination.data;
            const originVO = args.link.origin.data;
            this.linkDeleting.emit({ destination: destinationVO, origin: originVO });
        });
        this.diagram.addEventListener(Events.nodeDoubleClicked, (sender, args) => {
            console.log('node clicked twice');
        });
 



In above code click is working but double click event never get fired can you please let me know where is the problem with my code.

Note : I am creating custom node using updateVisuals.

Thanks
Ankur Shah
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Can we handle click Up and click down in custom node?
Reply #1 - Jan 17th, 2018 at 12:10pm
Print Post  
Hi,

You can handle the diagram canvas mouse events and check for an item under the cursor. For reference, check this topic: https://mindfusion.eu/Forum/YaBB.pl?num=1473921360/1#1.

As for nodeClicked and nodeDoubleClicked, they're raised as expected in my tests. Maybe there's something in your code, not shown here, that prevents the click event from firing.

Regards,
Lyubo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint