bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

Using `rowHeight` and `getRowHeight` works inconsistent in Gantt #9454

Open chuckn0rris opened 2 months ago

chuckn0rris commented 2 months ago

Not possible to use different row height for rows, also task bar height fill in the space if rowHeight used, and has wrong position if getRowHeight used.

Forum post

I'm trying to add variable height for my gantt rows with some logic such as this:

{
    fixedRowHeight: false,
    getRowHeight: (record) => {
        const taskType: string = (record as any).type;

        if (taskType === "project") {
            return 72;
        } else if (taskType === "category" || taskType === "subcategory") {
            return 38;
        } else {
            return 28;
        }
    },
}

This works for setting the row-height, but the height of the tasks in that row have 2 issues:

the task does not grow in height to fill the row the shorter task is not vertically centered in the row

Screenshot 2024-06-26 at 1.39.36 PM.png

To try and see what's going on, I tested setting a height of 72 in two different ways. I'll show the config followed by the result for each method:

  1. rowHeight
{
    rowHeight: 72,
}

Screenshot 2024-06-26 at 1.44.00 PM.png

  1. getRowHeight
{
    // rowHeight: COMMENTED OUT,
    fixedRowHeight: false,
    getRowHeight: (record) => {
        return 72
    },
}

Screenshot 2024-06-26 at 1.46.37 PM.png

Questions

I need help answering 3 questions:

Why do rowHeight and getRowHeight behave differently? When using getRowHeight to dynamically set row height, how can I get my tasks to be vertically centered? When using getRowHeight to dynamically set row height, how can I get my tasks to increase in height to fill the space their row gives them? Screenshot 2024-06-26 at 1.39.36 PM.png Screenshot 2024-06-26 at 1.44.00 PM.png Screenshot 2024-06-26 at 1.46.37 PM.png

matsbryntse commented 2 months ago

Related? https://github.com/bryntum/support/issues/8326

VictorBezak commented 1 month ago

I originally reported this issue in the Bryntum forums. I'm happy to provide more/clearer context if that would be helpful. Just let me know, happy to help in any way that I can 👍🏼