Closed iamnikhilrohan closed 3 years ago
Hello @iamnikhilrohan
You cannot access the information because it is already deleted.
Try this, I have changed the order of the event trigger before it has been deleted.
editor.removeNodeId = function (id) {
this.removeConnectionNodeId(id);
var moduleName = this.getModuleFromNodeId(id.slice(5))
if(this.module === moduleName) {
this.container.querySelector(`#${id}`).remove();
}
this.dispatch('nodeRemoved', id.slice(5)); //Changed
delete this.drawflow.drawflow[moduleName].data[id.slice(5)]; //Changed
}
Jero
Thanks @jerosoler for the lighting quick reply! and Thanks, it solved my problem.
Is there a way to get node info in node removed event
editor.on('nodeRemoved',function(id){ editor.getNodeFromId(id) })
i saw that getNodeFromId() returns an error when we try to access a removed node. Is there a way to get the info about the deleted node?