Hello. We have an undo functionality in gantt. We need to show the user a confirmation dialog on drag or resize of task before we apply the updates. However, the onBeforeTaskChanged is not asynchronous and the dialog is async so the task is updated before confirmation and added in the undo stack.
Hello Cairo,
If you want to show a confirm box, you need to return false at the end of the function regardless of the user response. Then, if the user agrees with the changes, you need to update the task with the Gantt API.
When you return false, the original task dates are restored, so, you cannot get them in the callback function (or the function you use in your application). So, you need to make a deep copy of the task object by using the copy method: https://docs.dhtmlx.com/gantt/api__gantt_copy.html
Thank you for the response. It somehow blocks the task update, but the parent projects remain drawn on the new dates and it didn’t revert when the user click ‘No’.