Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) diagram not display when clientsidemode is Canvas (Read 17724 times)
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #15 - Mar 17th, 2015 at 3:06pm
Print Post  
Okay...so how about Canvas? Although it is hiding somewhere on my app lol.

Does node click work on canvas mode?

Stoyo wrote on Mar 17th, 2015 at 3:02pm:
That's right, it only generates a static SVG image and does not support click events.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #16 - Mar 17th, 2015 at 3:16pm
Print Post  
Yes, but you must set AutoPostBack=true if you need to handle events on server side. The default in Canvas mode is to raise only client-side events, e.g. set NodeClickedScript to a name of JavaScript function that should be called to handle clicks.
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #17 - Mar 17th, 2015 at 6:02pm
Print Post  
Absolutely!
Thanks.

I tried to introduce a sample diagram from your sample folder to my application, it shows up under canvas mode. I guess I need to check my data generator.

Stoyo wrote on Mar 17th, 2015 at 3:16pm:
Yes, but you must set AutoPostBack=true if you need to handle events on server side. The default in Canvas mode is to raise only client-side events, e.g. set NodeClickedScript to a name of JavaScript function that should be called to handle clicks.

  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #18 - Mar 20th, 2015 at 3:16pm
Print Post  
Is there any other property that I should pay attention to handle server side node click event?

Now on my project diagram node under canvas mode is exactly "static" as it is under svg mode, not able to be clicked. But if I switch to ImageMap mode, (only changed clientsidemode thus everything else remained same), diagram nodes are clickable and triggered my server side clicked function.

I thought this just about postback didn't expect having trouble with it.  I enabled postback, declared OnNodeClicked/OnCellClicked, but still nodes are not clickable under canvas.

Stoyo wrote on Mar 17th, 2015 at 3:16pm:
Yes, but you must set AutoPostBack=true if you need to handle events on server side. The default in Canvas mode is to raise only client-side events, e.g. set NodeClickedScript to a name of JavaScript function that should be called to handle clicks.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram not display when clientsidemode is Canvas
Reply #19 - Mar 20th, 2015 at 5:34pm
Print Post  
It turns out AutoPostBack only submits for Created, Modified and Deleted events for nodes and links, sorry for misleading you. If you really want to post back for clicks, you will have to handle NodeClickedScript. E.g. assign some identifier for the node to a hidden field, call form.submit(), and in Page_Load check the hidden field's value. You might also consider calling a web service instead for more ajax-y experience.
  
Back to top
 
IP Logged
 
Xylon
Junior Member
**
Offline


I Love MindFusion!

Posts: 96
Joined: Feb 17th, 2014
Re: diagram not display when clientsidemode is Canvas
Reply #20 - Mar 20th, 2015 at 9:30pm
Print Post  
Okay,

thanks a lot

Stoyo wrote on Mar 20th, 2015 at 5:34pm:
It turns out AutoPostBack only submits for Created, Modified and Deleted events for nodes and links, sorry for misleading you. If you really want to post back for clicks, you will have to handle NodeClickedScript. E.g. assign some identifier for the node to a hidden field, call form.submit(), and in Page_Load check the hidden field's value. You might also consider calling a web service instead for more ajax-y experience.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint