Hi,is there a way to limit the time select for tasks to only one day in the lightbox?that is a task can only be planned within a day(cannot stretch beyond one day)
Hello,
you can remove the unneeded time selectors either by using time_format setting, or by hiding html elements of inputs manually. Html node of the control can be accessed with following code
var node = gantt.getLightboxSection('description').node;
Then you’ll be able to retrieve nested selects and hide them with ‘display:none’
docs.dhtmlx.com/gantt/api__gantt … ction.html
docs.dhtmlx.com/gantt/desktop__time.html
In order to limit resizing, you can use onTaskDrag event, and limit task dates there
docs.dhtmlx.com/gantt/api__gantt … event.htmlgantt.attachEvent("onTaskDrag", function(id, mode, task, original){
var drag = gantt.config.drag_mode;
if(mode == drag.resize){
if(task.end_date - task.start_date > 1000*60*60*24){//if more than 24
... do something
}
}
});
Additionally, you can validate each change using onBeforeTaskUpdate event
docs.dhtmlx.com/gantt/api__gantt … event.html