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

Getting an error when trying to delete nodes from diagram when added through tool

Hi guys
I'm using the line tool to create a node if there is no target node. What i've noticed is that when we use this to add a node if we try to delete the node from the diagram we get an error to say "Cannot read property 'segments' of undefined"
Please find an example in the zip at the following URL

https://1drv.ms/u/s!AgxIdbDPqmRThVeWqWwGJKBi5OfD

Thanks
Robert

5 Replies

SG Shyam G Syncfusion Team June 23, 2017 06:34 AM UTC

Hi Robert, 
 
The reported issue is an sample level issue. Please remove the highlighted line from linktool mousup in your sample to resolve your issue. Please refer to the code example below. 
 
Code example: 
 
class LinkTool extends ej.datavisualization.Diagram.OrthogonalLineTool { 
mouseup(evt) { 
 . . .  
. . . . 
. . . . 
  // this.diagram._updateEdges(this); 
. . .  
. . .  
}; 
}; 
 
Regards, 
Shyam G 



RW Robert Williamson June 23, 2017 07:50 AM UTC

Hi Shyam


Thanks for this i'm able to delete the nodes now. Just out of curiosity what does the _updateEdges do? 


Thanks

Robert



SG Shyam G Syncfusion Team June 23, 2017 12:14 PM UTC

Hi Robert, 
 
The _updateEdges method is used to update the incoming/outgoing connections of the node. We have used this method internally in our source to update the connection. So it’s not necessary to call this method in the application level. 
 
Regards, 
Shyam G 



SG Shyam G Syncfusion Team July 6, 2017 06:17 AM UTC

Hi Robert, 

Could you please confirm us whether you need to establish the connection with the ports. If yes, render the ports for the node initially and when you click on the connector tools, the ports will be visible and then you can establish the connection with the ports. Please refer to the sample below for your reference. 


Regards, 
Shyam G 



SG Shyam G Syncfusion Team July 6, 2017 06:19 AM UTC

Hi Robert, 
Please ignore our previous update. 
Regards, 
Shyam G 


Loader.
Up arrow icon