I have overridden event listener SelectionDeleting, which call server side API for delete record from DB, but before this response digram event listner deletes node.
I want to implement delete selected node only after successful deletion of record from DB.
undoManager.isEnabled is set to ‘false’, so can not do things like ‘myDiagram.commandHandler.undo()’
Yes, all actions happen immediately in the browser “in realtime”. If the user selects some parts and hits the delete key, those parts (and unselected links connected to selected nodes) are deleted.
So do you want to wait with the actual deletion until you get confirmation from the server that the deletion is allowed? Then I suggest that you override the CommandHandler.deleteSelection method to send the collection of selected Parts (probably just the keys of those Parts) to the server. When the server decides to actually do the deletion, it sends a message to the browser with a list of the keys to be deleted, which you handle in code by actually deleting those Parts within a single transaction.
If you have not already done so, you will want to turn on having the model always manage unique keys for links. Set GraphLinksModel.linkKeyProperty to the name of the link data property you want to use.