Disable _fix_dnd_scale_time

Hi,

We are trying to upgrade the widget from 4.1 to latest 7.0.8. While dragging a task to change the dates, the task becomes too small with same start date and end date. Upon investigation, I fond out “_fix_dnd_scale_time” function is calling calculateEndDate() and this will change the dates. But we do not want Gantt to change the dates or duration once the task is dropped automatically. The server updates the date on drop and return those new dates to be rendered for Gantt.

The config options:
config.auto_scheduling = false;
config.auto_scheduling_initial = false;
config.auto_scheduling_strict = false;
config.round_dnd_dates = false;
config.work_time = true;
config.correct_work_time = false;

Is there any way I can overcome this issue with some config options or if I can override this function?

Regards,
Pravin

Hello Pravin,

Probably the issue is related to the gantt.config.duration_unit property. If its value is 'day' and the task duration is less than 1 day, Gantt will round the duration to 0 or 1 days:
http://snippet.dhtmlx.com/5/79de6a430

You need to change it gantt.config.duration_unit property to 'hour' or 'minute':
http://snippet.dhtmlx.com/5/8f23c42a9

I have already tried setting gantt.config.duration_unit = ‘minute’. The Gantt takes long time to load after changing this.

For us, the server computes the start date, end date and duration based on other constraints as well. So, we do not want Gantt to calculate the dates.

Could you please let us know how to disable calculation of dates in drag-n-drop or is there any way I can override the function? This can help us to achieve better performance as effort for calculation of dates is not duplicated

Hello Pravin,

Thank you for the clarification. There is no way to change how Gantt works with tasks. If you drag a task or update its date via the lightbox, inline editor, or API call, Gantt will try to recalculate the date parameters. But if you disable the gantt.config.work_time option, Gantt won’t try to recalculate the duration and end_date parameters to fit the calendar settings.
Here is an example with 500 tasks and minute duration unit:
http://snippet.dhtmlx.com/5/43e6ee8d7

If that doesn’t help you, please, reproduce the issue in the snippet, then click on the “Share” button and send me the link:
https://snippet.dhtmlx.com/38ee1b370
Or send me a ready demo with all the necessary Javascript and CSS files so that I can reproduce the issue locally.