Hide gantt chart bar if there is no start and end date

Hello,

I would like to hide the bar of my tasks if there my variable start and end are empty. In other words, i do not want to display the vertical line if start and end date variables are empty. How do i do that?

Hi,
you can do it using the property “unscheduled” of a data item with the value true :
https://docs.dhtmlx.com/gantt/desktop__unscheduled_tasks.html
To hide or display the bar of the task and start time dynamically, you should add this feature in the lightbox using an additional button. You can add a button using the locale and config objects:
gantt.locale.labels.time_enable_button = ‘Schedule’;
gantt.locale.labels.time_disable_button = ‘Unschedule’;
and redefinition of the property “unscheduled” when the onLightboxSave event fires.
Please read in the article how to change buttons in the Lightbox:
https://docs.dhtmlx.com/gantt/desktop__custom_button.html
API onLightboxSave :
https://docs.dhtmlx.com/gantt/api__gantt_onlightboxsave_event.html
But if the problem still exists or I understood you incorrectly, please reproduce your issue in the snippet below, click the share button and send me the link:
https://snippet.dhtmlx.com/5/a40beee82