Closed bankkokbank closed 3 years ago
@BankkokBank you can simply hide the default delete button and implement your own in node html...
Hello @BankkokBank
The option that comments @MehbubRashid is correct.
Another option is to overwrite the function:
editor.removeNodeId = function(id) {
var r = confirm("Are you sure to delete?");
if (r == true) {
this.removeConnectionNodeId(id);
var moduleName = this.getModuleFromNodeId(id.slice(5))
if(this.module === moduleName) {
document.getElementById(id).remove();
}
delete this.drawflow.drawflow[moduleName].data[id.slice(5)];
this.dispatch('nodeRemoved', id.slice(5));
}
}
Thank you for suggest, It work for me
i want to create confirmation popup before delete node (using delete button). Just in case I use the delete button and use the onkeydown event but the node delete event first and confirmation popup follows after.