Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to make diagram readonly (Read 8122 times)
krantir
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Jan 25th, 2012
How to make diagram readonly
Jan 25th, 2012 at 2:38pm
Print Post  
Hi,
i am dynamically generating the diagram using json string and i need the diagram to be readonly. The user should not able to modify the diagram.

Thanks in advance
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make diagram readonly
Reply #1 - Jan 25th, 2012 at 2:57pm
Print Post  
Hi,

Set diagram.enabled = false and it will not handle mouse events. In our diagram controls that's usually done by setting Behavior = DoNothing, but our developers haven't ported that property to JavaScript yet.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
krantir
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Jan 25th, 2012
Re: How to make diagram readonly
Reply #2 - Jan 31st, 2012 at 9:51am
Print Post  
Is there any way to make the diagram readonly and mouse events like 'node click' should work?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make diagram readonly
Reply #3 - Jan 31st, 2012 at 10:07am
Print Post  
Hi,

In this beta version you could call e.cancelDrag() from the nodeModifying and nodeCreating validation event handlers:
https://mindfusion.eu/_beta/JsDiagram.1.3.zip

We'll try to implement the 'do nothing' behavior for the release in a few week.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make diagram readonly
Reply #4 - Feb 7th, 2012 at 11:28am
Print Post  
Hi,

We've uploaded a new beta build that adds the Behavior property:

https://mindfusion.eu/_beta/JsDiagram.1.3.zip

So this makes the diagram read-only, while it will still raise click events:
Code
Select All
var Behavior = MindFusion.Diagramming.Behavior;
diagram.setBehavior(Behavior.DoNothing); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mandz
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 12th, 2013
Re: How to make diagram readonly
Reply #5 - May 8th, 2013 at 1:48am
Print Post  
The link to the example provided in the last post doesn't seem to work.  Could you please fix it?  Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make diagram readonly
Reply #6 - May 8th, 2013 at 8:27am
Print Post  
That was a link to an old beta version. The Behavior property is available out of the box in the last few releases.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint