search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Scheduler / CSS / Event Background Colours

Asked by CTS
9 years ago.

If I set CSSOnly to False, I can change the background colours of the events dynamically on the beforeEventRender property, but when I use CSS themes (which do look a lot better than the default), the theme overrides the event backgroundcolour and I can't do this any more. Is there a middle ground. I'm trying to render the events as different colours depending on a rule so that the user can immediately view event statuses as colours. I've tried using a CSS prefix and setting CSSOnly to False, but that just comes out as the default look again. Help.

Answer posted by Dan Letecky [DayPilot]
9 years ago.

This is caused by the CSS theme definition. Some of the themes (white, green) use a gradient background which is defined using "background" property.

The e.BackgroundColor set in BeforeEventRender is applied on the _event_inner element as an inline background-color style. If you define background in the stylesheet this inline style will not be able to override the background color.

There are two possible solutions:

1. Create a custom class for each color you want to use and apply the class using e.CssClass instead of e.BackgroundColor.

2. Change the CSS theme so that it use background-color instead of background for _event_inner element. This way you won't be able to display the gradient though.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.