Event coloring

Hi,
I want to display event in different colors. Is this possible? Please let me know how can i implement, if its possible.

Thanks in advance.
Shiju

This is possible. There is a great link below for help with syling.

docs.dhtmlx.com/doku.php?id=dhtm … om_styling

Hello,

In first, I have to congratulating you for this nice scheduler :wink:

I made modifications for event coloring with :

scheduler.templates.event_class=function(start,end,event){ if (event.color == "red") return "red";
and I want to know if it’s possible to implement it with a colorpicker (wich appear in the editing window).

Thank you!

While it technically possible, by creating a custom form section, there is no ready to use solution.

It may be a much simpler to add a select list this possible color values

The select list with color values is a good idea for my project, in fact I have only 3 colors to use.

I tryed the code and If I write “travel” in my field, event will be green (for example). This is OK for it but I tryed to insert a form with selected list or 3 radio buttons and I can’t do it. Do you have an idea for creating this and write directly the value of the radio or list into the field?

I tryed this but this is checkboxes and it write only true or false

[code]
Valeur :

Bouton

[/code]

Thanks.

Check the attached sample
scheduler_radio.ZIP (49.1 KB)

Thanks Stanislav, that works great. Just one strange thing: when I refresh the screen with “F5” or when I’m comming on it, the event wich is the more on the left appears with the original color (black in my case) and I just have to click or move this event to make appear the right color. Have you ever seen this problem? This is not a real problem because I just have to change the original color (to be the same as the first radio button).

Thanks a lot!

Be sure that you have placed event_class template before loading | adding events. In your case it seems that event was rendered before new event_class template was defined.

Also, if you are using unit view, it possible that initially event has not any value for the custom property, but when you are starting event moving, scheduler sets default value for the property ( it is part of fallback logic of unit view ), and based on that default value new color is defined