Is it possible to check changes made on gantt?


#1

Hello!

Would there be a function or parameter on gantt that tracks/checks whether a task or configuration has been changed and not yet saved?


#2

Hello,
Most of the Gantt settings are changed via the API, so there are no built-in events that track when any of the Gantt properties change.
Gantt is a client-side library, all changes that occur in Gantt, they only occur in the browser. If you need to track when something has changed, but hasn’t yet been sent to the server, then if you use the Data Processor, you’ll need to use its event handlers:
onBeforeUpdate - fires before updating a record (records):
https://docs.dhtmlx.com/api__dataprocessor_onbeforeupdate_event.html ;
onBeforeDataSending - fires before sending data to a server:
https://docs.dhtmlx.com/api__dataprocessor_onbeforedatasending_event.html ;
onAfterUpdate - fires after receiving and processing server side response:
https://docs.dhtmlx.com/api__dataprocessor_onafterupdate_event.html ;
onAfterUpdateFinish - fires after receiving and processing ALL items in the response: https://docs.dhtmlx.com/api__dataprocessor_onafterupdatefinish_event.html ;
To get the task object before the changes are applied, you need to use the event handlers which are directly related to the changes of the task:
onLightboxSave - fires when the user clicks on the ‘Save’ button in the lightbox:
https://docs.dhtmlx.com/gantt/api__gantt_onlightboxsave_event.html ;
onBeforeTaskDrag - fires after the user has pressed the mouse button and started dragging, but before dhtmlxGantt starts the drag-and-drop operation:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdrag_event.html ;
onBeforeTaskAutoSchedule - fires for each task which is rescheduled:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskautoschedule_event.html ;
onRowDragStart - fires before the user drags a row of the grid to vertically reorder it:
https://docs.dhtmlx.com/gantt/api__gantt_onrowdragstart_event.html ;
onBeforeTaskChanged - fires after the user has finished dragging and released the mouse button, but before the changes are applied:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskchanged_event.html ;
onBeforeTaskDelete - fires before the user deletes a task:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdelete_event.html ;
onBeforeTaskMove - fires before a task is moved to a new vertical position:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskmove_event.html ;
If you want to track changes after the task object has changed, then you need to use these Gantt handlers:
onAfterTaskAdd - fires after the user adds a task to the Gantt chart:
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskadd_event.html ;
onAfterTaskDelete - fires after the user deletes a task:
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskdelete_event.html ;
onAfterTaskDrag - fires after the user has finished to drag and released the mouse button:
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskdrag_event.html ;
onAfterTaskMove - fires after a task was moved to a new vertical position:
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskmove_event.html ;
onAfterTaskUpdate - fires after the user updates a task:
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskupdate_event.html ;
onAfterTaskAutoSchedule - fires for each task which has been autoscheduled:
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskautoschedule_event.html ;