I have a requirement to use Gantt chart for an application I’m working on. Before purchasing a commercial license (because we need PDF support without watermarks) I have one User Story that it seems not be possible to implement with the current version.
US: The product owner wants to drag vertically the tasks from the gantt chart area instead of the grid area.
Apparently (from the samples), vertical drag and drop is enabled only for a grid area whereas horizontal drag and drop is possible on the gantt chart area.
Is it possible to have vertical drag and drop on the gantt chart area? Or do I need to implement this on top of dhtmlxGantt?
Hello,
We don’t plan to add this feature in the near future.
However, it is possible to implement it using current API.
Here are the examples.
In the first example you can drag rows vertically if you click on a row, not on a task. This is the easiest way to implement and to use it: snippet.dhtmlx.com/8372de20a files.dhtmlx.com/30d/35640ce696 … -20-53.mkv
If you want to drag rows clicking on tasks, here is another example, although it is more complicated to use. You can always drag tasks that are not selected. If you click on a task first time, the task will be selected, but you still can drag it. But if you click on it second time, you won’t be able to drag it anymore until you select another task: snippet.dhtmlx.com/c8efa62b5 files.dhtmlx.com/30d/9416bd142f … -30-32.mkv
In both examples we just add a grid column with an invisible row. You can always change the opacity to see how it really works.
Of course, these are just examples, you can add or use something else and implement the feature the way you think it should work.
Hello Jeremy,
There is no built-in feature to vertically reorder tasks. You need to implement a custom solution by using Gantt API and Javascript.
Both examples activate the event to reorder tasks via the grid. That’s why they don’t work when you disable the grid.
Actually, the snippet above is based on the snippet below, where you can reorder split tasks, maybe it will also help you: http://snippet.dhtmlx.com/50e77fce5
Thanks very much for getting back to me and for the new options - the thing the new options lack is the visual reordering of the rows as you drag, which is a requirement for us.
To try and keep this behaviour I have changed my grid to just have one column which is a reorder icon.
There seems to be a minimum width on the grid though that I can’t remove, so I have my icon column which is 40 px wide but my grid is always setting at 140px wide leaving me with a big 100px gap.
Is there any way to remove this min width? gantt.config.grid_width = 40; doesn’t seem to have any impact.