gantt Lightbox readonly time section

Hello,

I would like to disable time section in some cases.

  1. for milestone task I would like to disable only duration field (gantt_duration), because it should be always = 0
  2. for readonly task I would like to disable full time section, (gantt_time_selects and gantt_duration) here is example for type=project, but it’s not clear how to do it:
    docs.dhtmlx.com/gantt/samples/04 … _look.html

Thanks,
Alexey

Hi,
you can use ‘readonly’ and ‘single_date’ properties in config of a time control, check how it’s done in the default configuration of the lightbox:

gantt.config.lightbox = { sections: [ {name: "description", height: 70, map_to: "text", type: "textarea", focus: true}, {name: "time", height: 72, type: "duration", map_to: "auto"} ], project_sections: [ {name: "description", height: 70, map_to: "text", type: "textarea", focus: true}, {name: "type", type: "typeselect", map_to: "type"}, {name: "time", height: 72, type: "duration", readonly:true, map_to: "auto"} ], milestone_sections: [ {name: "description", height: 70, map_to: "text", type: "textarea", focus: true}, {name: "type", type: "typeselect", map_to: "type"}, {name: "time", height: 72, type: "duration", single_date:true, map_to: "auto"} ] };

Thanks for answer

but is it possible to disable time section in ‘onBeforeLightbox’ or ‘onLightbox’ by changing readonly property?

I have tried like this
gantt.getLightboxSection(“time”).section.readonly= false;

but it doesn’t work correctly

Hello,
you’ll need to reset the lightbox (regenerate it’s html) in order to get this options applied.
This is usually done from onBeforeLightbox event, check the sample
docs.dhtmlx.com/gantt/snippet/c12738ed

docs.dhtmlx.com/gantt/api__gantt … htbox.html
docs.dhtmlx.com/gantt/api__gantt … event.html