I need to color the date header in the month view based upon the type of day.

The example looks at the day of the month to decide it the header (and body) should have colors changed. This is resonably useless. I see the word “holiday” thrown around but if you search for it in the documentation you get no topics.

In one place in the documentation it shows the following line:


There is no definition of “events”, do i put that literal there, is that the name of an XML file, i have not a clue as to what that is. (Also remember that events is used in the documentation for two completely different objects and many times it is difficult to distinguish as to which event is being referred to. There are the “standard” events (e.g. onclick) and there are events that are added and deleted from the schedule.

So I have not a clue as to what event Id stands for.

The same holds true for event_name (without any documentation one wonders why there is and event id (literal) and an event name (not a literal). Evidently “type” is the name of the new field (xml tag?).

Anyhow my problem is simple.

html, body{ margin:0px; padding:0px; height:100%; overflow:hidden; } .good_day .dhx_month_body{ background-color: #FFFF80; } .good_day .dhx_month_head{ background-color: #EE91EC; }

iI do not know what something is in the sketch code above. Could somebody please help. I read the entire forum and anytime anyone asks about coloring the calendar they are sent to the example that colors the 11th and 16th days of the month.

Thank you
Charlie Elliott

This command assuming that you have table in DB, which is named “events” … iting_data

This code snippet can be used on server side, to load data from DB, it has nothing todo with client side operations.

Code which you are using correctly colors day-slots, based on “something.type”, can you specify, what exactly is not working in your case? (40.1 KB)

now i understand the $ stuff, we do not use php.

my problem is what is something, in something.type

i tried event.type which does not work

i tried date.type which did not work

i tried putting an onclick event on the div that did not work

my xml file looks like:


when “i see” a type of goodday, i want to color the bar for that day pink. i can trap the type in the .event_class=function but i cannot set the color of the header because (i think) it is in a different div.

	.goodday .dhx_month_head{
		background-color: pink;

so in the sketch code what is something?

thank you for your time

You are storing info inside event, but using template which colors day-scale not events, which is incorrect. You can color an event, by using its property, but you can’t color date-cell, based on some event which resides in it

To be correct, it possible to query events , which are related to the current day, but it will be a potentially performance killer.

Check the attached sample.
127182.ZIP (36 KB)

Thank you so very much, that is exactly what i need.

My next problem will be that I only want to show one month at a time. It appears as though I can cripple the buttons that exist and make my own buttons. When a user wants a new month i will go out to the database and “read” the new month.

Am I missing something, or is my thought process correct:

  1. cripple the arrow buttons on the form (delete the divs)
  2. make my own forward and back buttons
  3. on the click event reload the page with a different month

Once again, thank you not only for your solution, but also for your timely response


Actually grid already supports dyn. loading mode, which can do nearly the same … al_loading

Alternatively you can catch onBeforeView change event, and if new date ( parameter of event ) will be for different month - reload data ( clearAll, load )

Am I missing something, or is my thought process correct:
Yep, it also a possible solution, but you can check above approaches as well.

Thank you so much for your patience…

I looked at dynamic loading but i cannot find what the “file” is supposed to look like coming back to the scheduler, is it XML or something else. I would really like to send the data when asked for and update the data when changed

thank you again for being so prompt and informative

is it XML or something else
Yep, its the same xml data as for normal loading, just not all event but only for requested range of dates. ( normally it is some kind of server side script, which checks start and end parameters, and based on them sends xml data )

thank you, thank you, thank you…

You saved me hours of work and frustration. My dog also thanks you because he didn’t have to be kicked today :smiley: :smiley:

I think I am done for now

thank you again