gantt Lightbox readonly mode

Hello,

I would like to make reaonly mode for some of the tasks.

should I use code like this?
gantt.getTask(id).editable = false;
or
gantt.getTask(id).readonly = true;

How disable “save” button in the lightbox dialog?

How can I disable or enable root “+” button? Because only some of the users should have ability to add new root task.

Thanks,
Alexey

Hello,

Use ‘readonly’ property if you want to block some items in editable calendar. The ‘editable’ property goes from an opposite - if you set a global ‘readonly’ property, this will allow to unblock certain items.

You can block saving by returning a ‘false’ value from an onLightboxSave event
docs.dhtmlx.com/gantt/api__gantt … event.html

The easiest way is to do it with css:

.gantt_grid_head_add { display:none; }
check the snippet
docs.dhtmlx.com/gantt/snippet/bd32cf54

Hello Aliaksandr,

thanks a lot for your answer.

Anyway it’s more user-friendly to disable or remove ‘save’ button if user doesn’t have ability to modify specific task.

Maybe you have suggestions how do it?

Thank you,
Alexey

it works for me, but it’s not good solution, it’ll better to have readonly mode for lightbox

document.getElementsByClassName(“gantt_btn_set gantt_left_btn_set gantt_save_btn_set”)[0].style.display = “none”;

Hi,
the lightbox can be refreshed during the application, so you’ll need to set the state of the button using onLightbox and onLightboxChange events in order to keep lightbox in sync
check this snippet
docs.dhtmlx.com/gantt/snippet/19446c7c

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

Hi, thanks a lot, it’s good enough solution.