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?).
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.
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? 1274170073.zip (40.1 KB)
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:
green
johnson
goodday
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.
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.
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:
cripple the arrow buttons on the form (delete the divs)
make my own forward and back buttons
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
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.
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
charlie
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 )