Zum Hauptinhalt springen

onBeforeTaskDrag

Description

Wird direkt ausgelöst, nachdem der Benutzer die Maustaste gedrückt hält und mit dem Draggen beginnt, jedoch bevor dhtmlxGantt den Drag-and-Drop-Prozess startet.

onBeforeTaskDrag: (id: string | number, mode: string, e: Event) => boolean;

Parameters

  • id - (required) string | number - die Task-ID
  • mode - (required) string - der Drag-and-Drop-Modus ("resize", "progress", "move", "ignore")
  • e - (required) Event - ein natives Event-Objekt

Returns

  • result - (boolean) - bestimmt, ob die Standardaktion des Events ausgeführt wird (true) oder verhindert wird (false)

Example

gantt.attachEvent("onBeforeTaskDrag", function(id, mode, e){
//beliebige eigene Logik hier
return true;
});

Details

Dieses Event tritt auf, wenn eine Aufgabe innerhalb der Timeline gezogen wird.

Es kann durch Rückgabe von false blockiert werden, wodurch die Aufgabe auf ihre ursprüngliche Position zurückgesetzt wird.

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.