gantt icon indicating copy to clipboard operation
gantt copied to clipboard

Read only mode

Open sirgalleto opened this issue 3 years ago • 4 comments

Hey! is there a config for using a read-only mode? Without the user able to change the task start/end date?

sirgalleto avatar Apr 23 '21 02:04 sirgalleto

I don't think there is a setting for that, but you could easily do this within the CSS or with a line of jQuery.

.gantt .bar-wrapper {
    pointer-events: none;
}

...or if you prefer a jQuery alternative:

$('.gantt .bar-wrapper').css('pointer-events', 'none');

Either will prevent the tasks from being moved,

mikeott avatar Apr 23 '21 07:04 mikeott

A consequence of editing the CSS like that is that it prevents the popup from appearing on click as well.

djbpark1 avatar Aug 10 '21 19:08 djbpark1

I'm adding this to the freppe-gantt/master/src/index.js:702

if(typeof bar.task.read_only !== 'undefined' && bar.task.read_only === true){ return; }

then you only need to add read_only = true into a task that you want to be read-only.

Armxy avatar Sep 29 '21 12:09 Armxy

Hello. I was able to solve my problem by modifying the code. Look for the bind_events() function in the javascript file (dist/frappe-gantt.js), then comment on its content.

Igore-ADJOTIN avatar May 20 '22 18:05 Igore-ADJOTIN

Duplicate of #323.

safwansamsudeen avatar Apr 04 '24 20:04 safwansamsudeen