We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Adding multiple Nodes Connectors to Diagram with one Drag and drop from Palette

Thread ID:

Created:

Updated:

Platform:

Replies:

131806 Jul 27,2017 02:52 PM Aug 4,2017 12:35 AM ASP.NET Web Forms 3
loading
Tags: Diagram
Fabian Lorenz
Asked On July 27, 2017 02:52 PM

Hi Syncfusion Team,
I am using Diagram Builder Sample from Showcase Samples (Web Forms).
Like the subject says, I want to drag one Item from Palette to diagram which morphs
macro-like to multiple Connectors and Nodes (Like a macro or shortcut).
I came up with the following solution:

-Define a BasicShape which is added to Palette
-catch the element in the nodeOnDrop javascript function
-remove the Element
-define the connectors and nodes myself in javascript
-add it to the diagram where the Pallette item was dropped

Unfortunately I cant remove the Element, because it seems to
get added by another function after nodeOnDrop has finished.
I was not able to find the place where the node was added to
diagram. Maybe you can point me to the place in the source
files. As I said I used the source Code from Diagram Builder
in Showcase Samples.

Regards,
Fabian

Shyam G [Syncfusion]
Replied On July 28, 2017 02:28 AM

Hi Fabian, 
 
To achieve your requirement, please cancel the drop event by setting args.cancel=true and then add a new nodes and connectors. Please refer to the code example below. 
 
Code example: 
 
DiagramContent.OnClientDrop = "nodeondrop"; 
 
function nodeondrop(args) { 
    args.cancel = true; 
    //add a new node 
diagram.add({ name: "firstNode", width: 100, height: 100, offsetX: args.element.offsetX, offsetY: args.element.offsetY }); 
} 
 
Regards, 
Shyam G 


Fabian Lorenz
Replied On August 3, 2017 11:45 AM

Hi Shyam,

works as expected. Nice and simple. Thank you!


Shyam G [Syncfusion]
Replied On August 4, 2017 12:35 AM

Hi Fabian, 
Please let us know if you need further assistance on this. 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;