apex-plugin-dhtmlx-gantt
apex-plugin-dhtmlx-gantt copied to clipboard
Reordering tasks vertically
Hi, I need to sort the tasks vertically and save the order in the database, how can I do it?
I had the same problem this month. Reordering in the Left side grid is not possible. You have to change/extend the plugin to do it, but it's quite easy.
- Add new Event: Task Row Drag End (Grid) - Internal name "dhtmlxgantt_task_row_drag"
- Add the event in the file plugin-dhtmlxgantt-helper.js
//catch task ROW drag event for APEX, so that a dynamic action can be registered
//boolean onBeforeRowDragEnd(string|number sid,string|number parent,number tindex);
// https://docs.dhtmlx.com/gantt/api__gantt_onbeforerowdragend_event.html
gantt.attachEvent("onBeforeRowDragEnd", function(id, parent, tindex){
var data = {
parent_id: gantt.getParent(id),
task: gantt.getTask(id)
};
apex.event.trigger(plugin_dhtmlxGantt.chartContainerIdElement, "dhtmlxgantt_task_row_drag", data);
});
You can now reference the new Event in a Dynamic Action. https://docs.dhtmlx.com/gantt/api__gantt_onbeforerowdragend_event.html