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

How do I change the colours of events in the month calendar depending on event type? (CSS Only)

Asked by Phil
9 years ago.

I need to change the colour of the event based on data values.

Comment posted by Phil
9 years ago.

I understand I need to modify the CssClass property in the BeforeCellRender event - but how do I get access to the current event data in this event? BeforeCellRender has the tag property to get the data but has no CssClass property to modify. Based on the data (in the tag property) I need to change the CssClass which defines how the event is displayed. How can I do this?

Answer posted by Ruben
9 years ago.

You can change this the scheduler "BeforeEventRender" event

Here I advise you to create your own layout, using labels, divs, ...

this can be done using the "e.tag" values you get from your event.

Once you've got the layout you want, place it, into the e.InnerHTML

(or thats what I did..)

Comment posted by Phil
9 years ago.

Ok - I was hoping to be able to just change the cssclass - but this should work too.

Thanks

Phil

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

You can add a custom class to the event div using e.CssClass in BeforeEventRender.

More on how this works:

http://forums.daypilot.org/Topic.aspx/1907/month-changing-event-background-colors

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