Skip to content
Advertisement

Dragging tasks within the end date of source task DHTMLX Gantt

i customize a DHTMLX gantt with my db. For Data i only choose id, text, start_date, duration and end_date. For links i choose id, souce, target and type, all types are 0.

I’ve done dragging task together with their dependent task, moving task manualy. Moving Descendants synchronously with the main task( link: https://docs.dhtmlx.com/gantt/desktop__dragging_dependent_tasks.html#movingtasksmanually )

I’ve add to my gantt.aspx this code:

JavaScript

Advertisement

Answer

In the onTaskDrag event handler you have the task object of the task you are dragging. For the related tasks, there is the child variable, though the tasks are not necessarily the children of the dragged task. So, you can get the end date of the task you are dragging from the task object. In the onAfterTaskDrag event handler, you don’t have the task object, but you can get it by using the gantt.getTask(id) method:

JavaScript

https://docs.dhtmlx.com/gantt/api__gantt_gettask.html

You can also use the auto-scheduling feature: https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement