The MindFusion Forums | |
Flow Diagramming Components >> ASP.NET >> Loaded from xml diagram opens in some view mode
https://mindfusion.eu/Forum/YaBB.pl?num=1487930193 Message started by Vitaliy on Feb 24th, 2017 at 9:56am |
Title: Loaded from xml diagram opens in some view mode Post by Vitaliy on 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?
|
Title: Re: Loaded from xml diagram opens in some view mode Post by Slavcho on 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.
https://mindfusion.eu/Forum/YaBB.pl?action=downloadfile;file=MindFusion_Diagramming.zip ( 126 KB | 174
Downloads )
|
Title: Re: Loaded from xml diagram opens in some view mode Post by Vitaliy on 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.
|
Title: Re: Loaded from xml diagram opens in some view mode Post by Slavcho on Feb 24th, 2017 at 2:36pm Quote:
Where are you getting the workflowTemplate value from, server-side or client-side SaveToString call? |
Title: Re: Loaded from xml diagram opens in some view mode Post by Vitaliy on 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.
|
Title: Re: Loaded from xml diagram opens in some view mode Post by Slavcho on 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.
|
Title: Re: Loaded from xml diagram opens in some view mode Post by Vitaliy on 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
https://mindfusion.eu/Forum/YaBB.pl?action=downloadfile;file=Silverlight.txt ( 2 KB | 151
Downloads ) https://mindfusion.eu/Forum/YaBB.pl?action=downloadfile;file=HtmlDiagram.txt ( 0 KB | 192
Downloads )
|
Title: Re: Loaded from xml diagram opens in some view mode Post by Slavcho on 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 |
Title: Re: Loaded from xml diagram opens in some view mode Post by Vitaliy on 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):
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? |
Title: Re: Loaded from xml diagram opens in some view mode Post by Slavcho on 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. |
Title: Re: Loaded from xml diagram opens in some view mode Post by Slavcho on 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 -
https://mindfusion.eu/_beta/netdiag_xmlalpha.zip Regards, Slavcho Mindfusion |
The MindFusion Forums » Powered by YaBB 2.6.11! YaBB Forum Software © 2000-2024. All Rights Reserved. |