How can we put two task in a same row


#1


similar to this


#2

Hello Nitish,
You can do that by using the Split Tasks feature:
https://docs.dhtmlx.com/gantt/desktop__split_tasks.html
Here are examples:
https://docs.dhtmlx.com/gantt/samples/04_customization/11_split_task.html
https://docs.dhtmlx.com/gantt/samples/04_customization/21_open_split_task.html


#3

if we have split task then can we drag taskbar horizontally. i know we can drag whole row but i want to drag task only is it possible.


#4

Hello Nitish,
By default, you can drag only one task even in the split mode.
To drag the whole row with tasks, you need to enable the gantt.config.drag_project parameter and enable the mouse events for the split project task.


#5

sorry, i guess i was not able to explain you the question properly. here i am sharing one example.


here i want to drag & drop Stage #1 block only horizontally not whole row is that possible?


#6

Hello Nitish,
If you want to move Stage #1 horizontally, you can easily do that:
https://files.dhtmlx.com/30d/9692c633aab0685de4b3d4570f22a81e/vokoscreen-2021-06-15_13-13-59.mkv

If you want to move it vertically, there is no built-in way to do that. You will need to implement a custom solution by using the Gantt API and Javascript.
I have the following example of the implementation that can help you to start:
http://snippet.dhtmlx.com/ab2abfb16


#7

Hi Ramil,
Here after successful drag. If their is no task in the row in that case whole row is getting removed can we avoid that. i want that row to stay as it is even if the task in not their after drag


#8

Hello Nitish,
If you mean the use case like in the following video, it is expected behavior, because after you move all children to other tasks, the initial task is displayed and its type is changed to task. After you move that task somewhere else, you actually move it to another place, and it doesn’t have any children:
https://files.dhtmlx.com/30d/8a58f987af48fa1ebd73caaba7e36aa0/vokoscreen-2021-06-23_11-51-58.mkv
Otherwise, it would mean that the task always produces its children.

However, you can comment the following line, and you will see that the task type is not changed to task after you remove all its children from it. And by default, you won’t be able to drag that task until you add children to it:

if (children.length == 1) original_parent.type = gantt.config.types.task;

Here is the snippet and the video:
http://snippet.dhtmlx.com/5/b44e35223
https://files.dhtmlx.com/30d/8969faa74d98c6fbec86d38314608380/vokoscreen-2021-06-23_12-04-56.mkv

Also, the snippets where you can vertically reorder tasks in the timeline are only examples of the implementation. You may encounter some issues with it as it is not tested.
In the future, the dev team will add that feature, but I cannot give you any ETA.
If you want us to implement something for you, you can contact the Sales team:
info@dhtmlx.com