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
close icon

Diagram.clear() is not cleaning layers and throwing an exception

I am trying to clear a diagram and then redraw it.. when I run use diagramInstance.clear.. it throws an exception when I add the first node.. and I think it is because the node still exists in the layers.

I have a node with id ='start'

I have it in a layer.. I clear the diagram. I try to add the start node back.. and get this:
the goal is to clear the diagram and the layers to start fresh.. 

is there a preferred method to really clear the diagram at runtime .. or is there a big in clear that it is not learning the layers?

can I reset the layers?

Unhandled Rejection (TypeError): null is not an object (evaluating 'diagramDiv.parentNode')

1 Reply

SG Shyam G Syncfusion Team November 14, 2019 04:18 PM UTC

Hi Raphael, 
We have checked by clearing the diagram using diagram clear method. We could not able to replicate an issue at our end. Could you please share us more details such as modify the below sample. 
Shyam G 

Live Chat Icon For mobile
Up arrow icon