Apply changes on custom save button



We are using DHTMLX Gantt and using a custom toolbar for save functionality. If we do a change in the Gantt cell and click on save button, changes will not be affected unless we hit enter after making a change in the Gantt cell or click on header cell of the column or click on a different cell.

Please note that we are getting the updated values from “onAfterTaskUpdate” event. Could you please recommend us a way to get the updated content when we click on a custom save button (without hit enter after updating a cell).

Thank you.

Kind regards,
Madhuka Lakshan.


Hello Madhuka,
If you use inline editors, you need to click on a grid cell to edit it. Then Gantt will open the inline editor. When you add or change the value, you make the changes only inside the inline editor element. The task object is not changed until the inline editor is closed. It works that way by design.

You can trigger the method when you click on the Save button:
Here is an example of how it can be implemented:

Another way is to not use the inline editors at all. Instead, you can use the template function in the column configuration:
With that approach, you can return any HTML elements in the grid and attach custom functions to edit the task object when you edit the HTML elements.

Here is an example of how it can be implemented: