Discuss anything related to web development but no technical support questions

Post by dominicdolan »

is there any way to apply styling on the fly to tasks segments like can be done in the task renderer.

I have custom colors all setup through the TaskRenderer that apply to my tasks, but the issue i have is as soon as i split a task the split segments do not get any of the styling from the taskRenderer, they just appear in the default style and color. and i cant find anyway to apply my custom styling to segments of a task in the task renderer

as simple example of a style i apply in the task render is change the task to red if its overdue
renderData.style = "background-color: " + overdueColor + " !important";

Post by dominicdolan »

Also the eventColor doesnt seem to work properly with segments
to a task i can apply an event color like so:
data.eventColor = "#0093ff";
and i get a html result like so:
<div class="b-gantt-task b-sch-event-resizable-true b-segmented" data-task-feature="task" role="presentation" style="background-color: rgb(0, 147, 255);">

but when i apply the same to a segments eventColor i get a class that does nothing:
<div class="b-gantt-task b-sch-event-resizable-true b-sch-color-#0093ff b-sch-event-segment b-first" data-segment="0" role="presentation" style="left: 0px; height: 25px; width: 25px;">

if i use the word for example blue this does created the expected class that gets added but the color of the segment on the gantt is still the default gantConfig color

Post by marcio »

Hey dominicdolan,

Thanks for reaching out. We have a ticket to allow the behavior that you mentioned to event segments https://github.com/bryntum/support/issues/6745.

I added a note to the ticket.

Best regards,

Post Reply