I just started working on a project with gantt 5.0.5 in which I need to change the order of my tasks with the drag-and-drop feature. So I’ve been following along the Node.js example with gantt.config.order_branch = true (but I haven’t set gantt.config.order_branch_free because I want the tasks to stay on the same level):
docs.dhtmlx.com/gantt/desktop__ … deroftasks
The problem I’m running into is that in my app.put("/data/task/:id", …) function, the target I’m getting out is correct if I drag the task down but incorrect if I drag the task up the task list.
- For example, when I drag “Task #1.1” on top of “Task #1.2”, I get a target of 6 for “Task #1.2”, which is correct.
- But then when I drag it back up again on top of “Task #1.2”, I get a target of 3 for “Task #2”, which is wrong.
- Similarly, when I drag “Task #2.2” on top of “Task #2.1”, I get a target of 4 for “Task #3”, which is wrong.
Please note that you don’t necessarily need a backend framework to replicate this issue. The following code should log it to the JavaScript console:
gantt.attachEvent(“onRowDragEnd”, function(id, target) {
console.log(id + ’ ’ + target);
});
on this example: docs.dhtmlx.com/gantt/samples/0 … ering.html .
I think this is a bug, but I may be missing something in how I’m parsing the event. Any assistance would be greatly appreciated–thank you!!!
(I just tested with the cdn.dhtmlx.com/ version 4.1.0 and it does not have this issue, but 5.0.5 does.)