How to do basic Operation in Javascript Syncfusion Diagram

Dear Syncfusion,

I have followed the instruction in the online documentation for syncfusion javascript diagram , Those article tells about how to initialize and create diagram at very first time when page was loaded. But I have a question, about how I add or delete a node at the current diagram?  Please just give me a sample code for this problem. I've try to find something in Class Reference but I have found nothing. It would be better you can provide more references.. (I have file attached if you want to analize it :) )

Thank's and Best Regards,
Syukur    

:)

Attachment: Index_645ba70e.rar

1 Reply

SG Shyam G Syncfusion Team July 7, 2014 06:10 AM UTC

Hi Syukur,

Thanks for using Syncfusion products.

We are glad to inform you that we have created a simple sample to represent how to perform add and delete a node in Diagram JS. Please see the code snippet below.

1.Delete a node.

diagram.remove();

2.Add a node.

var node = { name: ej.Diagram.Util.randomId(), width: 50, height: 50, offsetX: 400, offsetY: 200, type: "node", shape: { type: "rectangle" } };

diagram.add(ej.Diagram.Node(node));         

Please let me know if any concerns.

Regards,

Shyam G


Attachment: WebApplication6_(3)_cb654298.zip

Loader.
Up arrow icon