onLightboxSave doesnt update

Hi ,

I am trying to update a value of the task on the onLightboxSave event .

Something like below.
gantt.attachEvent(“onLightboxSave”, function(id, task, is_new){

 var task = gantt.getTask(id);
 var follows = task.follows;
 var project = task.projectId;
 task.follows = project+"_"+ follows;
 console.log("Follows : "+task.follows);
return true;


But on refresh the value doesnt get updated.

Thanks in adavance

Hello Rameshwari,
It happens because of wrong API usage.
There is the modified task object in the onLightboxSave event handler:
It overwrites all changes in the existing task object.
You try to modify the changes in the existing task object, so it is expected that it doesn’t work.
Instead, you can use the task object from the function.
Also, you don’t need the following lines:


The changes will be repainted and the task will be updated after you return true in the onLightboxSave event handler.
Here is the updated snippet where it works correctly: