Different lightboxes for add / update

Hello.
I need different lightbox models (with different fields) for add and update actions.
Is there a way I can get something like that?

Hello Diego,
You can change the lightbox configuration in the onBeforeLightbox event handler then reset the lightbox so that Gantt will build a new lightbox form:

if (task.$new) gantt.config.lightbox.sections = lightbox_new_task_sections;
else gantt.config.lightbox.sections = lightbox_edit_task_sections;
gantt.resetLightbox(); 

https://docs.dhtmlx.com/gantt/api__gantt_onbeforelightbox_event.html
https://docs.dhtmlx.com/gantt/api__gantt_resetlightbox.html
The following snippet demonstrates how it works:
http://snippet.dhtmlx.com/00e882d1f

1 Like