Editing restrictions for particular tasks and dependencies in Gantt

Hi. We need to restrict editing for particular tasks in Gantt according to their properties (for example, tasks with specific dates or statuses must be readonly and other tasks must be editable). Also some dependencies must be restricted. For example, dependency between task and its children is not allowed.

Does Gantt provide support for this functionality?

Hello Anton,
To make some tasks read-only, you need to enable the readonly property for them:
https://docs.dhtmlx.com/gantt/desktop__readonly_mode.html#readonlymodeforspecifictaskslinks
Another way is to prevent editing tasks with the event handlers:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforelightbox_event.html
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdrag_event.html
https://docs.dhtmlx.com/gantt/desktop__inline_editors_ext.html#events
Here are examples:
https://snippet.dhtmlx.com/5/c982af417
https://snippet.dhtmlx.com/5/c8f9ac162

If you enable auto-scheduling and parent tasks have the project type, you won’t be able to create child-parent links:
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html
https://docs.dhtmlx.com/gantt/desktop__task_types.html#projecttasks
Here is an example:
https://snippet.dhtmlx.com/5/3fae1b026
For other cases, you need to return false in the onLinkValidation event handler:
https://docs.dhtmlx.com/gantt/api__gantt_onlinkvalidation_event.html
Here is the snippet:
http://snippet.dhtmlx.com/5/b9dee209f

1 Like