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;
 gantt.updateTask(task.id);	
 gantt.refreshTask(task.id,true);	 
 gantt.refreshData();
 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:
https://docs.dhtmlx.com/gantt/api__gantt_onlightboxsave_event.html
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:

 gantt.updateTask(task.id);	
 gantt.refreshTask(task.id,true);	 
 gantt.refreshData();

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:
http://snippet.dhtmlx.com/5/6c6a88262