- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.JavaScript pack. It includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are more details and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Loaded from xml diagram opens in some view mode
Read 3068 times

Vitaliy   Offline
YaBB Newbies
*
Posts: 7
I Love MindFusion!


   
     
 
Loaded from xml diagram opens in some view mode
Feb 24th, 2017 at 9:56am
 
When diagram is loaded from xml there is no grid, and shapes selection is not the same when create diagram. There is some "view" mode. I cannot draw links between shapes. How I can enable "edit" mode?
 
 

WorkflowReadOnly.JPG (13 KB | 171 )
WorkflowReadOnly.JPG
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #1 - Feb 24th, 2017 at 12:21pm
 
You are calling client-side Diagram.loadFromXml method? It wasn't loading Grid* and Behavior properties, so they remained with initial values. Attached new version of the script should load them now.
 
 
 
IP Logged    
 
     

Vitaliy   Offline
YaBB Newbies
*
Posts: 7
I Love MindFusion!


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #2 - Feb 24th, 2017 at 2:08pm
 
I use server-side initialization of Diagram. Use _diagramView object of DiagramView class. Call  _diagramView.LoadFromString(workflowTemplate) method to load from string that is in xml format. after that I tried to set  _diagramView.Behavior = Behavior.Modify, but result is the same.
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #3 - Feb 24th, 2017 at 2:36pm
 
Quote:
Call  _diagramView.LoadFromString(workflowTemplate) method to load from string that is in xml format.


Where are you getting the workflowTemplate value from, server-side or client-side SaveToString call?
 
 
 
IP Logged    
 
     

Vitaliy   Offline
YaBB Newbies
*
Posts: 7
I Love MindFusion!


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #4 - Feb 24th, 2017 at 3:15pm
 
I use client-side SaveToString, save that string to database, when I load page I read that value and write it to workflowTemplate variable. I try now save diagram with Silverlight and I can open diagram i "edit" mode by DiagramView. After that I save this diagram from DiagramView httlm page( client side) and open diagram in "read only" mode after that. I compare xml text after Silverlight and after DiagramView saving and see that after DiagramView saving xml text doesn't have  <ShowGrid>True</ShowGrid> for example.
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #5 - Feb 24th, 2017 at 6:16pm
 
The scripts attached above also implement saving grid properties from client side. If you call diagram.saveToString from JavaScript code, you'll need to use the new .js file to have ShowGrid saved.
 
 
 
IP Logged    
 
     

Vitaliy   Offline
YaBB Newbies
*
Posts: 7
I Love MindFusion!


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #6 - Feb 27th, 2017 at 10:03am
 
I use js file attached above, but something wrong. I attach xml files of empty diagram saved with Silverlight and DiagramView client-side
 
 

Silverlight.txt (2 KB | 156 )
HtmlDiagram.txt (0 KB | 173 )
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #7 - Feb 27th, 2017 at 12:54pm
 
So you have a very old Silverlight version of the control and want to exchange saved diagrams between it and the JavaScript / ASP.NET version? Note the format identifiers in XML files -

<Diagram Version="12"> in Silverlight
<Diagram Version="17"> in JavaScript

Generally we maintain backward compatibility for file formats but not forward one, so the older Silverlight version won't be able to load v17 format correctly, you might need to upgrade to latest Silverlight build if you need to move data from JavaScript to Silverlight.

Then the oldest format supported by JavaScript's loadFromXml is v13 (see Misc section in http://mindfusion.eu/Forum/YaBB.pl?num=1478545974) so it cannot load everything from the Silverlight file correctly either. We'll try to extend it one version back to support v12 format too in next few days. Until then you could use server-side LoadFromXml method to load older files - in .NET code we should have compatibility for even older formats.

Regards,
Slavcho
Mindfusion
 
 
 
IP Logged    
 
     

Vitaliy   Offline
YaBB Newbies
*
Posts: 7
I Love MindFusion!


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #8 - Feb 27th, 2017 at 1:58pm
 
I will redefine my question as this =>

This old version of XML (version=12) is loaded through asp.net back-end libraries(for backwards compatibility as you mentioned), and saving is done at client side with java-script which creates XML (version=17). Although grid options is set on aspx control like this:

Code (HTML):
  <Diagram RouteLinks="true" GridStyle="Lines" AlignToGrid="True" ShowGrid="True" GridColor="#1B000000" GridSizeY="10" GridSizeX="10">
                            </Diagram>
 



the diagram loaded (again through same mechanism) is missing grids on canvas. The only difference is that newer XML (version=17) missing such parameters as do older versions has.

So the question is what is needed to set (anywhere) that grid would be displayed?
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #9 - Feb 27th, 2017 at 2:31pm
 
The grid color saved in HtmlDiagram.txt is transparent (with 0 alpha value), our developer will investigate where it could come from.
<GridColor>#00000000</GridColor>

At this time you could reset GridColor from code after loading to show it.
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1746
Gender: male
tech.support


   
     
 
Re: Loaded from xml diagram opens in some view mode
Reply #10 - Feb 28th, 2017 at 11:51am
 
Our XML serializer wasn't parsing correctly rgba(...) strings, used to store colors with semi-transparency in .js library. This build should fix that -
http://mindfusion.eu/_beta/netdiag_xmlalpha.zip

Regards,
Slavcho
Mindfusion
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print