More dates when dragging a task

Hello

I have a problem with Gantt. If the task duration (both start and finish dates) are not in the frame, How can I drag it to the next dates which are not shown in the frame?

For example, in the following sample, I want to drag Task’s finish date to 20 May with mouse.

Hi @ma_albert!

Each time a timeline scale changes its start_date and end_date values the render() method is called, which is quite resource-intensive. Therefore, the values ​​of the boundaries of the scale are static by default.

You can set the fit_tasks property to true. It ‘says’ the Gantt chart to automatically extend the time scale in order to fit all displayed tasks. Here is a related article:
https://docs.dhtmlx.com/gantt/api__gantt_fit_tasks_config.html
Here is a gif you can see how it can be used:
http://recordit.co/qOw85PoYGW

You can also extend scaled dynamically during drag and drop, by repainting gantt from onTaskDrag event, here is a working demo: http://snippet.dhtmlx.com/0e9d36d13
But please keep in mind that it can work slowly on large charts.

You can configure gantt.config.start_date and gantt.config.end_date property to change the range.
Here are the related articles, snippet and GIF:
https://docs.dhtmlx.com/gantt/api__gantt_start_date_config.html
https://docs.dhtmlx.com/gantt/api__gantt_end_date_config.html
http://snippet.dhtmlx.com/d0346720a
http://recordit.co/NSBzsL0Qxi

Here is the article about the timeline scale range:
https://docs.dhtmlx.com/gantt/desktop__configuring_time_scale.html#range