Adding Custom Headers with 3 status:
Admin Posted (Studio Class)
Teacher Posted - Not booked (Available)
Teacher Poster - Booked (Booked)
So implemented code as per your information in your Docs section. Added the code into the site, now the site is running VERY slow. Code has been placed into dhtmlxscheduler.js
There are two icons - a Green checkmark and a red “X” icon. Both are 1k each, I’ve tried with and without the icons and code runs slow either way, so its not the icons causing the issue.
Here is code:
scheduler.templates.event_header = function (start, end, ev) {
var headerText = "";
jQuery.ajax({
url: "/Home/CheckBookingForHeader",
type: "POST",
data: { start: start.toUTCString(), end: end.toUTCString(), "roomid": ev.room_id },
async: false,
success: function (data) {
// alert(data);
if (data == "Admin") {
headerText = "<b style='color:white'>Studio Class</b>";
}
if (data == "True") {
headerText = "<img src=/images/red-x-icon.gif style='float: left; width: 12px; margin-left: 30%;'></img><b style='color:red;float:left;'>Booked</b>";
//alert(headerText);
//headerText = "<b style='color:red'>Booked</b>";
//alert(headerText);
}
if (data == "False") {
headerText = "<img src=/images/greencheckmark.gif style='float: left; width: 12px; margin-left: 30%;'><b style='color:green;float:left;'>Available</b>";
//alert(headerText);
//headerText = "<b style='color:green'>Available</b>";
//alert(headerText);
}
},
error: function (jqXHR, textStatus, errorThrown) {
headerText = "<b style='color:green'>Available</b>";
}
});
//alert(headerText);
return headerText;
};