Update task with lightbox values manually after blocking lightbox save

Hi,

I’m trying to figure out how to manually update a task with the modified lightbox values after blocking the lightbox save. I’m blocking that because of a validation question, but when the user clicks Yes, I have to manually save the task somehow.

The updated task is in the task object of the onLightboxSave event, but how can I update this?

Thank you.

Maurice

gantt.confirm({
	text: vWarnSchedsametrade,
	ok: vYes, 
	cancel: vNo,
	callback: function(result) {
		//console.log(result);
		if (result == true) {
			
						
			//gantt.updateTask(id);
			console.log(id);
			console.log(task);
			
			//save task manually

			gantt.hideLightbox();
		}
		else {
			
			return false;
		}
	}
});

Hello Maurice,
If you call a confirm box, it works in an asynchronous way. So you don’t need to return anything because when you click on the “Yes” button, the “Lightbox Save” event is gone. But you still have all variables. So you just copy all values from the modified task object into the non-modified task object, close the lightbox and use gantt.updateTask() command to see the changes.
Here is the snippet:
https://snippet.dhtmlx.com/oip2jnfu

That works like a charm, thank you!