Foros de discusión
ALLOY-UI Diagram Builder Save
Girish Panchal, modificado hace 10 años.
ALLOY-UI Diagram Builder Save
New Member Mensajes: 2 Fecha de incorporación: 11/07/13 Mensajes recientes
Hi i wanted to know how can we save Alloy UI diagram to XML or JSON and how to retrieve it back?
there is method toJSON ,how to Use it ?
this is my jsp page code
Thanks
there is method toJSON ,how to Use it ?
this is my jsp page code
<script src="http://cdn.alloyui.com/2.0.0pr5/aui/aui-min.js"></script>
<link href="http://cdn.alloyui.com/2.0.0pr5/aui-css/css/bootstrap.min.css" rel="stylesheet">
<script>
YUI().use(
'node',
'transition',
'aui-diagram-builder',
function (Y) {
var availableFields = [
{
iconClass: 'aui-diagram-node-start-icon',
label: 'Start',
type: 'start'
},
{
iconClass: 'aui-diagram-node-task-icon',
label: 'Task',
type: 'task'
},
{
iconClass: 'aui-diagram-node-end-icon',
label: 'End',
type: 'end'
}
];
var diagramBuilder = new Y.DiagramBuilder(
{
availableFields: availableFields,
boundingBox: '#myDiagramContainer',
fields: [
{
name: 'StartNode',
type: 'start',
xy: [10, 10]
},
{
name: 'EndNode',
type: 'end',
xy: [300, 400]
}
],
srcNode: '#myDiagramBuilder'
}
).render();
}
);
</script>
<div id="myDiagramContainer">
<div id="myDiagramBuilder"></div>
</div>
Thanks
Girish Panchal, modificado hace 10 años.
RE: ALLOY-UI Diagram Builder Save
New Member Mensajes: 2 Fecha de incorporación: 11/07/13 Mensajes recientes
ok i am able to save JSON data, now question is can i use this data to reproduce my graph?
priyanka upadhyay, modificado hace 9 años.
RE: ALLOY-UI Diagram Builder Save
New Member Mensaje: 1 Fecha de incorporación: 3/12/14 Mensajes recientes
Can you please tell me how to save the alloy UI diagram into database or any format??
prakash vidja, modificado hace 8 años.
RE: ALLOY-UI Diagram Builder Save
New Member Mensajes: 22 Fecha de incorporación: 9/11/12 Mensajes recientesGirish Panchal:
ok i am able to save JSON data, now question is can i use this data to reproduce my graph?
Hi
I have the same problem.
Can you please tell me how you have saved diagram to Json ?
if possible please provide example.
Thank you
Kyle Joseph Stiemann, modificado hace 8 años.
RE: ALLOY-UI Diagram Builder Save
Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientesprash patel:
Can you please tell me how you have saved diagram to Json ?
if possible please provide example.
Hi Prash,
To save the DiagramBuilder, simply use the toJSON() method.
- Kyle
prash patel, modificado hace 8 años.
RE: ALLOY-UI Diagram Builder Save
New Member Mensajes: 22 Fecha de incorporación: 9/11/12 Mensajes recientes
Thanks. I am able to save and retrieve diagram.
Kyle Joseph Stiemann, modificado hace 8 años.
RE: ALLOY-UI Diagram Builder Save
Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientesGirish Panchal:
... can i use this data to reproduce my graph?
Maíra Araujo:
... if you're getting this JSON data from AlloyUI's DiagramBuilder's toJSON method then you should be able to just pass it to a new instance of DiagramBuilder as the fields key of its configuration object, like this:new A.DiagramBuilder({fields: jsonData.nodes}).render();
See María's full post for more details.
- Kyle