Closed JMidd91 closed 6 years ago
Maybe an onInputChange may be a good shout also, or onInputRemoval
onDelete must be called after or before deleting node?
Component's destroyed()
provide such ability (calls after a node deleted)
If you want to execute some method before deleting or even prevent deletion, you can subscribe to the noderemove
event
editor.on('noderemove', node => {
return false; // false to prevent
});
// or editor.eventListener in v0.7.4 and earlier
oh ok i will give that a try!
could you give me a basic example of where destroyed() would go in a component ? im running v0.7.3 at the moment. I couldnt find it in the docs
https://github.com/retejs/rete/issues/72
new D3NE.Component('mycomp', {
builder(node){ },
worker(node, inputs, outputs){ },
created(node){ }.
destroyed(node){ }
});
Awesome thank you very much. Will give it a try ASAP.
this works a charm! can be closed now 👍
Hi,
would it be possible to implement an onDelete function to the nodes?
so any code we put into the onDelete part of a node, it executes before it gets removed from the screen when we hit the delete key.
kind of like a final update? incase we need any thing removing that our nodes added.
hope that makes sense!
kind regards