Our state of the art Gantt chart


Post by bala24 »

Hi,

In the code attached, the first task "Progress Tracking" is shown as a milestone. It should be shown as a task. Not able to figure out the issue. Please help in fixing this ?
The second task "Action Planning" is correctly showing up as task with bar.

Thanks in advance,
Bala.

const MyGanttView = () => {
    const ganttRef = useRef(null)
    const tasks = [{
        "id": 0,
        "name": "Parent - 1",
        "startDate": "2024-08-13T09:00:00+05:30",
        "endDate": "2024-08-14T09:00:00+05:30",
        "expanded": true,
        "children": [
            {
                "id": "019122d7-9ffa-75b1-9c42-82d5d734221f",
                "name": "Child - 1",
                "startDate": "2024-08-14T09:00:00+05:30",
                "duration": 0,
                "rollup": true,
                "taskType": "step",
                "description": "---description - child - 1---"
            },
            {
                "id": "019122d7-9ffa-75b1-9c42-82e8b76301e9",
                "name": "Child - 2",
                "startDate": "2024-08-14T09:00:00+05:30",
                "duration": 0,
                "rollup": true,
                "taskType": "step",
                "description": "---description -child-2 ---"
            }
        ],
        "cls": "stage-container",
        "taskType": "stage",
        "description": "---description text---"
    },
    {
        "id": 1,
        "name": "Parent - 2",
        "startDate": "2024-08-14T11:30:00+05:30",
        "endDate": "2024-08-14T17:00:00+05:30",
        "expanded": true,
        "children": [
            {
                "id": "019122d7-9ffa-75b1-9c42-8312bfb02bdf",
                "name": "Child - 1",
                "startDate": "2024-08-14T12:00:00+05:30",
                "duration": 0,
                "rollup": true,
                "taskType": "step",
                "description": "---description text---"
            },
            {
                "id": "019122d7-9ffa-75b1-9c42-832061f3b7fc",
                "name": "Child - 2",
                "startDate": "2024-08-14T17:00:00+05:30",
                "duration": 0,
                "rollup": true,
                "taskType": "step",
                "description": "---description text---"
            }
        ],
        "cls": "stage-container",
        "taskType": "stage",
        "description": "---description text---"
    }]

const ganttConfig = {
    readOnly: true,
    viewPreset: "hourAndDay",
    rowHeight: 60,
    project: {
    autoSetConstraints: true,
    tasks: tasks,
    },
    rollupsFeature: true,
    projectLinesFeature: false,
    eventMenuFeature: false,
    scheduleMenuFeature: false,
    headerMenuFeature: false,
    taskTooltipFeature: false,
    cellEditFeature: false,
    cellMenuFeature: false,
    columnReorderFeature: false,
    taskMenuFeature: false,
    taskEditFeature: false,
    rowReorderFeature: false,
    columnLinesFeature: false,
    columnLines: false,
    rowLinesFeature: false,
    rowLines: false,
    zoomOnTimeAxisDoubleClick: false,
    sortFeature: false,
}
return <BryntumGantt ref={ganttRef} {...ganttConfig}/>
}
Last edited by bala24 on Wed Aug 07, 2024 7:36 pm, edited 1 time in total.

Post by tasnim »

Hi,

It's because the parent tasks are calculated from the child tasks. So if you don't want this to happen you can set https://bryntum.com/products/gantt/docs/api/Gantt/model/TaskModel#field-manuallyScheduled to true on that parent and it should work the way you want to.

To learn more about task scheduling please study our guides here https://bryntum.com/products/gantt/docs/guide/engine/gantt_events_scheduling

Best regards,
Tasnim


Post by bala24 »

Thanks for quick response Tasnim. Setting that flag resolved it.


Post Reply