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. Image for the cookie policy date

How to capture event when the user drags a shape to the diagram space

I am trying to create a flowchart and allowing the user to continue the remaining flowchart.

I have given option to drag and drop the shapes in the diagram space

how will i capture the event when he drags a shape

reffered below

Please do help me

5 Replies

NG Naganathan Ganesh Babu Syncfusion Team November 1, 2019 01:32 AM

Hi SaiSravya, 

We suggest you to use diagram’s “dragEnter” events to find the node to drag to the diagram space. Also, use dragEnter evtArgs “Cancel” property to cancel the node to adding into the diagram space. Please refer to the below our online UG documentation link and sample. 

Online UG documentation link: 



If we misunderstood your requirement, please share us more information about your requirement probably a video/screenshot of the requirement, which will help us to analyze further and provides a better solution. 

Regards, 

Naganathan K G 



SA SaiSravya November 1, 2019 02:04 AM

Could you please send me some examples for the link you have provided?


SG Shyam G Syncfusion Team November 3, 2019 08:24 PM

Hi SaiSravya,  
 
Please look into the below code example to define dragEnter event. This event triggers when a dragged node from palette with mouse enters a diagram. 
 
Code example: 
<ejs-diagram #diagram id="diagram" width="100%" height="700px" (dragEnter)='dragEnter($event)'  (created)="diagramCreate()" [nodes]="nodes">  
                </ejs-diagram> 
 
public dragEnter(args: IDragEnterEventArgs): void {  
 // do your own logic 
  }  
 
 
 
 
Regards, 
Shyam G 



SA SaiSravya November 3, 2019 09:26 PM

I am facing issue with the styling part which is from OpenNew.css 

I couldnt find that file in the code which you have shared

Kindly let me know from where i can get..

Thanks much for helping us

Attachment: error_8849fb0d.rar


SG Shyam G Syncfusion Team November 4, 2019 01:34 AM

Hi SaiSravya,  
 
Sorry for the inconvenience. 
 
The OpenNew.css file is not needed for our diagram component. So we have removed it from our sample. Please refer to a modified sample below. 
 
 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon