您的位置:首页 > 其它

mxgraph q&a

2012-05-02 07:22 77 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/standyxu/article/details/84211922

Eventually I need to be able to exchange between js and server beans. Does mxGraph provide some Ajax abstractions for different browsers?
mxXmlRequest is mxGraphs cross-browser abstraction for XHR.


How can I perform a round-trip (load/save) in mxGraph using the .NET or Java back-ends?
.NET
Refer to the Save.ashx and Deploy.ashx examples in dotnet/aspnet. The Save example demonstrates how to save the XML, while the Deploy.ashx demonstrates how to deploy an editor and the diagram in the same page.
Java
The roundtrip.java example (com.mxgraph.examples.web.Roundtrip) is a Java servlet that demonstrates both saving to and loading from a server. The Main example in the same package contains an embedded Jetty servlet engine, you can run it as a Java application and it will deploy at
http://localhost:8080.
Navigating to that page offers the roundtrip example link, demonstrating loading a diagram, then saving it again.

 

Is there a way to record all the changes made by user to the graph displayed, save it at server side(in xml format or any)? (Then when the user loads the page again, display the latest graph: Am able to do this). Am unable to find a hook to the first part, ie, recording and saving the changes at server side.
Use a graphmodel change listener as shown on line 667 ff. in mxGraph (the changes are in evt.getProperty('edit').changes). 搜('edit').changes

 

Hi, I am researching this library. Is it possible to use JSON for the payload between server and client?Our development team has standardized its usage (JSON) and want to see if we can use it insterad of the XML that you use.
Yes, that's possible. However, since we use an XML format, we don't provide any classes or file formats for this. The mxXmlRequest can be used with any format though.

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: