Support for v6.x of our Scheduling components


Post by Scheuring »

Hi there,

How do I change the color of :before and :after elements of task bars in eventRenderer, so they match the bar?

Attachments
Screenshot 2021-11-11 155837.jpg
Screenshot 2021-11-11 155837.jpg (31.63 KiB) Viewed 1099 times

Post by johan.isaksson »

Hi,

They get their color from a specific border-color. I would override the rule for that using CSS, to inherit the border-color instead. And then set the border-color in the style property of eventRenderer, making it propagate down to the pseudo elements. Something like this (need some adjustments to fully work):

// css
.sch-gantt-parenttask-bar:after,
.sch-gantt-parenttask-bar:before {
  border-color : inherit;
}

// js
eventRenderer() {
  return {
    style : 'border-color: ...'
  };
}
Best regards,
Johan Isaksson

Post Reply