Gantt confirm before any event

I want to use confirm before any event fired.

	gantt.attachEvent("onBeforeTaskDrag", function (id, mode, e) {
		//any custom logic here
			text: "Veriler Değişecektir. Emin misiniz?",
			ok: "Yes",
			cancel: "No",
			callback: function (result) {
				if (result) {
					confirm = true;

				} else {
					confirm = false;

		return true; // here returns true before callback function executed.

in this link example is shown but I want to use "confirm " result in other events,
I placed the other event in the function metioned above link, but both events works firstly event the result

I need to confirm an event before it happened. how can I do that?

Hello Komek,
Some event handlers are asynchronous otherwise the page would hang.
To make everything work in those event handlers, you need to return “false” (or in some cases do not return anything) by default. And then use the callback function in the confirm message.
Here is an example: