Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to subscribe to node clicked event? (Read 2459 times)
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
How to subscribe to node clicked event?
Oct 5th, 2016 at 10:49am
Print Post  
Hi,

I find it difficult to subscribe to node click event. I tried js (as shown in sample) and server side, but those event seems to never happening. So there is probably a problem the way i describe them, it seems that i need to do something extra, maybe enabling some property?. I'am interested in client/server side.

Could someone help with that?
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: How to subscribe to node clicked event?
Reply #1 - Oct 5th, 2016 at 1:30pm
Print Post  
Gravity wrote on Oct 5th, 2016 at 10:49am:
Hi,

I find it difficult to subscribe to node click event. I tried js (as shown in sample) and server side, but those event seems to never happening. So there is probably a problem the way i describe them, it seems that i need to do something extra, maybe enabling some property?. I'am interested in client/server side.

Could someone help with that?



Ok, found it
On client script you need to set property of diagramming control like so:
...
   NodeClickedScript="onNodeClicked"
...

   <script type="text/javascript">
   
         function onNodeClicked(sender, args) {
       
            if (sender == null)
                return false;

            var node = args.getNode();

            console.log("node", node);

            return true;
        }

    </script>
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: How to subscribe to node clicked event?
Reply #2 - Oct 5th, 2016 at 2:28pm
Print Post  
Right. You could also handle some events on server but clicked is not among them. If you enable AutoPostBack, the control will post back after create, modify, delete and text-edit operations and raise respective DiagramView events.

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