Problem with changing the background color of an event

Hello

First i want to say how i love this project. Incredible work DHX-Team :slight_smile:

I need to change the background color of the events.
I found the sample “01_events_coloring.html” but there the color takes effect when you choose an option in the lightbox. I need this automatically. I try to explain it:

I have a formular where i make my changes and can see the data. In the scheduler i want to create an event for this data - ColourID = 1. If i make changes in the formular the ColourID gets a new ID (2 for example). Another special change - ColourID = 3. I have maximum 4 colours. The point is when sheduler is loading the event need to know his ID and change the colour.

Any ideas?

Thank you

You can define your custom css template, which will assign different colors based on ColourID value.
Each time when event is repainted - it will call template and use latest value of ColourID to generate name of css class.

Also, in version 3.0 there is a more simple way to color events, you can set @color property of event and it will be used as bg-color.

ev.ColourID = 1; ev.color = "red";