Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordering tasks vertically #32

Open
mappo1980 opened this issue Sep 13, 2023 · 1 comment
Open

Reordering tasks vertically #32

mappo1980 opened this issue Sep 13, 2023 · 1 comment

Comments

@mappo1980
Copy link

Hi, I need to sort the tasks vertically and save the order in the database, how can I do it?

@jzzh
Copy link
Collaborator

jzzh commented Sep 27, 2024

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.

  1. Add new Event: Task Row Drag End (Grid) - Internal name "dhtmlxgantt_task_row_drag"
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants