Error following the steps in the tutorial on Vertical drag and drop task

Hi there,
I have read the drag and drop function in 1 chartt in the example:

when i run the code, is shows up this also in terminal is showing up

‘target_task’ is constant no-const-assign


Hi @longhai,
The snippet you use relies on the addTaskLayer method which is available in PRO versions only.
Looks like you’re using a free GPL edition of gantt, which does not have it. That would explain the error you see.
If you have a paid license, you’ll need to replace a free version of gantt with a PRO version in your project.
Currently, we don’t provide npm install for PRO version, so adding a PRO version of gantt to the project would take a couple of manual steps, please check this article on how to do it

Another solution I could advise you is to use the custom vertical drag
realization without addTaskLayer method, like this one:
In this topic you can read more about custom vertical drag and drop solutions:
Vertical drag and drop from the gantt chart area

1 Like

tks a lot @Siarhei ^^ and have a nice day

@Siarhei in this one : DHTMLX Snippets
I edited a bit in ‘data’, didn’t change the code. And as you can see in the image i tag in below this comment : The stage #3 overlap and cover stage # 4.
Any solution disable it? Thanks

Hi @longhai,
To avoid this issue, you should include the “Auto Scheduling” extension(available only in the PRO) and set the auto_scheduling property to true: gantt.config.auto_scheduling = true;
Auto scheduling makes the start date of the second task update according to the end date of the first task each time when it changes.
Note: To make it work, you should also create dependencies between tasks, to make gantt understand how it should schedule them.
Here is corrected snippet:
Auto Scheduling: