I have a schedule in Month view. I would like to block scheduling changes for appointments that appear on the schedule but that are more than 2 months old. I have tried to use addMarkedTimespan and nothing appears on the schedule (it looks the same). I don’t know if I am doing something wrong or perhaps you can’t block dates in Month view? I want the user to be able to see the schedule but not make changes (so change background to gray would be fine).
Thanks in advance!
Here is a snippet of my code:
[code]…
var config ={
start_date: new Date(2011,2,16),
end_date: new Date(2013,2,16),
css: “gray_section”,
days: “fullweek”,
type:“dhx_time_block”
}
scheduler.init('scheduler_here', new Date(), "month");
scheduler.setLoadMode("month");
scheduler.load("data/XML-PHP-1.php");
scheduler.addMarkedTimespan(config);
scheduler.updateView();
–can you block days for scheduling when they are in the past and already contain events? I would like the events to be there but not allow the user to make changes to them if they are in the past.
–can you do this in Month view?
–do you declare it before the scheduler is loaded?
–from my code can you see any reason why no days are being grayed out? (ie the calendar looks as if you can schedule on any day, when I want some days grayed out)
Hi,
by default marked timespans does not shows up in the month view.
You can enable them with following css rule: .dhx_scheduler_month .dhx_marked_timespan{
display: block;
}
But, I would like to see the previously scheduled events behind the gray (they are not visible). Is it possible to see the loaded events even when block the dates for updates to the schedule?
The above solution is working great for Month view. However, if I click to Week or Day view, I don’t see the events (only the grayed out CSS). Is there something a need to add to be able to see the events in front of the grayed out CSS for the dates that have been set with addMarkedTimeSpan?
I had posted that I wasn’t able to view the previously scheduled events in Month view in a timespan defined by addMarkedTimeSpan. This now works. However, similarly I cannot see the previously scheduled events in Week/Day view (I believe they are hidden behind the CSS for the blocked days).
I believe I am missing some CSS but not sure what to add to make this work…
Hi,
looks like i’ve specified z-index only to event of month view. If you add it to .dhx_cal_event as well, events will show up.
Here is the updated css .dhx_cal_event_clear, .dhx_cal_event_line, .dhx_cal_event{
z-index: 1;
}example is attached 01_basic_init_fix.zip (1.01 KB)
scheduler.attachEvent("onTemplatesReady", function() {
// Setting up holidays
var holidays = [new Date(2013, 01, 01), new Date(2013, 7, 7), new Date(2013, 7, 30)];
for (var i = 0; i < holidays.length; i++) {
var date = holidays[i];
var options = {
start_date: date,
end_date: scheduler.date.add(date, 1, "day"),
type: "dhx_time_block", /* creating events on those dates will be disabled - dates are blocked */
css: "holiday",
html: "Holiday"
};
scheduler.addMarkedTimespan(options);
}
});
im able to mark timespans quite well. Only question i have is that when in month view, only part of the cell is marked, div.dhx_month_body is colored as i want to, but div.dhx_month_head remains with its default color. Is this normal behavior? Thanks
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan