OnBeforeTaskUpdate has a bug


#1

OnBeforeTaskUpdate cannot get past values, only the latest values


#2

Hello,
This is expected behavior, and you can find that information in the article:


https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskupdate_event.html

If you mean that you try to obtain the task object with the gantt.getTask(id) command and you get the modified task object, it is because the event fires after the task is actually modified in the datastore.

You need to use the specific event handlers before the task is modified:
onBeforeTaskDrag fires when you drag a task in the timeline:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdrag_event.html
onLightboxSave fires when you modify a task in the lightbox:
https://docs.dhtmlx.com/gantt/api__gantt_onlightboxsave_event.html
onBeforeSave fires when you modify a task property in the inline editor:
https://docs.dhtmlx.com/gantt/desktop__inline_editors_ext.html#events