I am doing tree/treetable drag and drop and want to allow the user to choose via a ModalBox whether the dropped node should become a child of the target node or a sibling of the target node. To do this I place a ModalBox at the beginning of the onBeforeDrop function expecting that the user can choose the desired method before the drop takes place. My problem is that the ModalBox does not seem to interrupt the “drop” process workflow i.e. the node is dropped (with a default method) before I receive the user’s answer from the ModalBox. How can I force the “drop” workflow to wait for the ModalBox to complete? Thank you.
While ModalBox prevents user interaction with an app, it doesn’t really block the js execution, as native confirm
do. There is no way to fully block the js execution, so there is no way to wait for user’s decision.
Currently, the only solution is to block the default drag-n-drop processing. Wait for user’s decision, and if user confirms the action, call move
API to move the dragged item in the necessary position.
That’s what i do, i’m using the move API. Thanks for the tip Maksim