gantt
gantt copied to clipboard
Read only mode
Hey! is there a config for using a read-only mode? Without the user able to change the task start/end date?
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,
A consequence of editing the CSS like that is that it prevents the popup from appearing on click as well.
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.
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.
Duplicate of #323.