Page 1 of 1

same styles for gantt and scheduler

Posted: Tue Sep 09, 2025 2:09 pm
by romanwurm

Hi,

if I am using gantt and scheduler, I recognized that eventStyle is not supported by Gantt.
Can I somehow manually apply those styles to gantt tasks to ensure consistent styles? I know that I can apply style to tasks but I want to apply exactly the styles from the built in eventStyles also to gantt tasks.
If this is not possible, do you plan to support eventStyle for the gantt control?

Thanks, Roman


Re: same styles for gantt and scheduler

Posted: Tue Sep 09, 2025 2:29 pm
by tasnim

Hi Roman,

Gantt doesn't expose eventStyle, but you can reuse the built‑in Scheduler styles by adding the same CSS classes to task bars (via the task data cls/style or the taskRenderer). For example:

new Gantt({
  taskRenderer({ taskRecord, renderData }) {
    const style = taskRecord.eventStyle || 'plain';
    renderData.cls = (renderData.cls || '') + ` b-sch-event-${style}`; // add Scheduler style class
    return taskRecord.name;
  }
});

Also set task.eventColor or gantt.eventColor for matching colors. See the Scheduler eventStyle docs (TimelineEventRendering#config-eventStyle) and the Gantt taskRenderer (GanttBase#config-taskRenderer) for details. I’m not sure about plans to add a native eventStyle config to Gantt.


Re: same styles for gantt and scheduler

Posted: Tue Sep 09, 2025 9:47 pm
by romanwurm

Hi,

I tried following code in your demo but it doesn't seem to apply the style in the gantt control.

Demo:
https://bryntum.com/products/gantt/examples/gantt-schedulerpro/

// gantt config
taskRenderer({ taskRecord, renderData }) {
        renderData.cls = (renderData.cls || '') + ` b-sch-event-hollow`; // add Scheduler style class
        return taskRecord.name;
    },   

From my understanding it should apply the hollow style to the bars...but nothing changes.
Anything I am missing?

Thanks, Roman


Re: same styles for gantt and scheduler

Posted: Wed Sep 10, 2025 12:21 pm
by ghulam.ghous

Hi Roman,

It is not possible at the moment. Need some tweaks at the base level so correct styles are applied when event style classes are present. But the good news is we have implemented this functionality in 7.0.0 which is expected to go out at the end of October. Not all styles are gonna look good because of how the parents are rendered. Here is a sneak peek:

Screenshot 2025-09-10 at 3.20.56 PM.png
Screenshot 2025-09-10 at 3.20.56 PM.png (612.13 KiB) Viewed 546 times

Re: same styles for gantt and scheduler

Posted: Wed Sep 10, 2025 12:38 pm
by romanwurm

Perfect, thanks...then I'll be waiting till end of october :-)
Roman