Colorizing the markers depending on the event

Hello,

I have the following code in my file:

			{view:"richselect",   id:'subject', label:"Soort", name:"subject", yCount:"6", options:[
                           {value:"afspraak",label:"Afspraak"},
                           {value:"training",label:"Training"},
						   {value:"netwerken",label:"Netwerken"},
						   {value:"interview",label:"Interview/Gap-analyse"},
						   {value:"intern",label:"Vergadering/belsessie/int.opl."},
                           {value:"afwezig",label:"Vakantie/afwezig/privé"}

What I would like to accomplish is that, depending on the option the user selects, the marker in the daylist and month view changes it’s color that is predefined for that subject. I have gone through the whole forum and tried to modify examples that were given but I am stuck.

Suppose that a user selects the first option (“afspraak”) and I want the marker to show up red, how do I do that? An example would be greatly appreciated.

Thank you,
Kees

Hello,

you can use event_marker template. For example:

scheduler.templates.event_marker = function(obj,type){ var colors = {"afspraak": "red", "training": "blue", "netwerken": "green"}; var c = (colors[obj.subject]||"#E6F8FF"); return "<div class='dhx_event_marker' style='background-color:"+ c +"'></div>"; };

Alexandra,

It works like a charm. Thank you!

Kees

I was happy to help )