Confirm before delete

Hi
how can I set confirm before deleting an element, I tested with this jquery code and it worked:

e.cancel = !confirm(“Are you sure?”);

But I want to use it with a bootstrap modal to confirm which does not return true as a result doesn’t work

My code: -----------------------------------------------------------------------------------

if (typeof args.OnDelete == ‘function’) {
myDiagram.addDiagramListener(“SelectionDeleting”, function (e) {
args.OnDelete(e);
});
}

OnDelete: function (e) {
e.cancel = $("#myModal").modal(‘show’);
}

And I set onclick=“return true” on my confirm button

Is there any way to fix this?
Any help?

Thanks,
Milamdo

Please read what the Change Log discusses about DiagramEvent.cancel: GoJS Change Log, under “Deprecated features”.

I believe the whole notion of trying to insert a modal operation into a normal sequential process is full of dangers and complications. I recommend that you change your workflow rather than implement what you are trying to implement.

Hi Walter, Thanks for the reply and suggestion.
I will check it out