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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is it possible to call this.setState() in IDropEventArgs?

Thread ID:





143057 Mar 2,2019 08:47 AM UTC Mar 6,2019 11:55 AM UTC ReactJS 3
Tags: ejDiagram
Ryosei Yawata
Asked On March 2, 2019 08:47 AM UTC


I tried to call this.setState({}) in IDropEventArgs of drop event.
but the following error appears:

ej2-diagrams.es5.js:27754 Uncaught TypeError: Cannot read property 'children' of undefined
    at DiagramComponent../node_modules/@syncfusion/ej2-diagrams/dist/es6/ej2-diagrams.es5.js.Diagram.removeObjectsFromLayer (VM5207 bundle.js:45987)
    at Droppable.droppable.drop (VM5207 bundle.js:49965)
    at Observer../node_modules/@syncfusion/ej2-base/src/observer.js.Observer.notify (VM5207 bundle.js:9105)
    at Droppable../node_modules/@syncfusion/ej2-base/src/base.js.Base.trigger (VM5207 bundle.js:2697)
    at Droppable../node_modules/@syncfusion/ej2-base/src/droppable.js.Droppable.intDrop (VM5207 bundle.js:5058)
    at Draggable../node_modules/@syncfusion/ej2-base/src/draggable.js.Draggable.intDragStop

Is it impossible to call thi.setState() here?
alternatively, I choose the way to edit node info by call doubleclick event and show modal.but it is better to call this.setState() in IDropEventArgs  and show modal.


Ramya Thirugnanam [Syncfusion]
Replied On March 4, 2019 07:22 AM UTC

Hi Ryosei,  
Thanks for contacting Syncfusion support. 
Please use collectionChange event instead of drop event If your requirement is to modify the node after dropped from symbol palette to diagram. The node gets added to diagram with args.state as changed and we can modify the node.  
For more information about collectionChange event please refer to below help documentation link 
Could you please provide us the screenshot or description about your requirement with this.setState method in drop event? This will help us to serve you better. 
Ramya T 

Ryosei Yawata
Replied On March 6, 2019 10:38 AM UTC

Hi Ramya T,

Thank you for your answer.
Yes, I also found that I can call this.setState in collectionChange in API document and solved the issue.

Best Regards,


Ramya Thirugnanam [Syncfusion]
Replied On March 6, 2019 11:55 AM UTC

Hi Ryosei, 
Thanks for your update. 
Ramya T 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon