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

Option to enable grouping and add multiple tasks to a row #448

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

iaminamcom
Copy link

I was in need to add group so that I can add tasks to specify rows. I found #95 is still open and solutions there are working but not compatible with new version.
Here's an implementation which allow user to enable or disable grouping also fixes rows, lines issues.

What changed

You need to add following to options

new Gantt('.gantt-target', tasks, {
    enable_grouping:  true,
    // Other options...
});

and in tasks will be like

let tasks = [
    {
        start: '2024-03-30',
        duration: '12h',
        name: 'Write new content',
        id: 'Task 1',
        progress: 5,
        // important: true,
        group: 0,
    },
    {
        start: '2024-04-01',
        end: '2024-04-01',
        name: 'Redesign website',
        id: 'Task 0',
        progress: 30,
        group: 0,
    },
    {
        start: '2024-04-02',
        end: '2024-04-02',
        name: 'Apply new styles',
        id: 'Task 2',
        progress: 80,
        group: 0,
    },
    {
        start: '2024-04-04',
        end: '2024-04-04',
        name: 'Review',
        id: 'Task 3',
        progress: 5,
        group: 1,
    },
    {
        start: '2024-04-06',
        end: '2024-04-06',
        name: 'Deploy',
        id: 'Task 4',
        progress: 0,
        group: 1,
    },
];

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

Successfully merging this pull request may close these issues.

1 participant