Hello,
But there should be a way to store the nodes position, right?. For example an event when the node is moved or something like that?
Regards.
Hi Israel,
Could you please confirm us whether you need to save the position of nodes. if yes, you can save the diagram to retain the diagram nodes/connectors position. Please refer to the online sample link below.
online sample: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/diagram/serialization
Regards,
Shyam G
Hello Shyam,
Thanks for your quick response. I need to store the position of the nodes, but I do not want to save the diagram, since the position of the nodes with all the information in order to draw the diagram is stored on an external database, and this is just a representation of that model.
Therefore, I need to store in my model the position of the nodes (and all the rest of info, but the other info might not be updated)
Regards.
Hi Israel,
Please use positionChange event which triggers when we drag a node and you can track the position of node in this event. Please refer to a code example and the sample below.
Code example:
|
App.component.html
<ejs-diagram #diagram id="diagram" width="100%" height="800px" (positionChange)="positionChange($event)" >
App.component.ts
public positionChange(args: IDraggingEventArgs) { if (args.state === 'Completed') { } } |
Sample: https://stackblitz.com/edit/angular-xc2w49?file=app.component.ts
Regards,
Shyam G