а

How to know which type of editing was done by the user?


#1

On the server-side I want to change in the database only what the user has edited.
Is there any way to tell on the server side if the user has changed the data through inlinEditor, drag-drop, resize task, etc? Currently, if the user changes only the start_date or textField in inlineEditor, all data referring to the task is sent to the server.
How can I know on the server-side what exactly was changed?


#2

Hi @douglas!

There is no built-in Gantt feature to send only the updated data to the server. You need to implement a custom solution. This can be done by using Gantt API and Javascript.

You can save the state of the task in onLightbox and onBeforeTaskDrag event listeners in the global variable.
https://docs.dhtmlx.com/gantt/api__gantt_onlightbox_event.html
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdrag_event.html

Then compare it with the changed task’s data in onLightboxSave and onAfterTaskDrag event listeners.
https://docs.dhtmlx.com/gantt/api__gantt_onlightboxsave_event.html
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskdrag_event.html

Then initialize the Data Processor by using the createDataProcessor function and specify the update action there.
https://docs.dhtmlx.com/gantt/api__gantt_createdataprocessor.html

Here is a snippet you can see how it can be implemented:
http://snippet.dhtmlx.com/30369c436