I’m having a problem with the view not displaying the scheduler when I add the following line to my controller index method:
[*]scheduler.BeforeInit.Add(“defineTemplates();”);
I have added a defineTemplates() function to my javascript file:
function defineTemplates() {
//**
//Override to add color css
//**
scheduler.templates.event_class = function (start, end, event) {
// Get filter values
var filterColorRange = $("#propertySelectForm #ColorRange").val();
// Check filter values
if (filterColorRange == "Reservation Status") {
if (event.reservation_status == 'unconfirmed')
return "unconfirmed_event";
else if (event.reservation_status == 'confirmed')
return "confirmed_event";
}
else if (filterColorRange == "Gender") {
if (event.gender == 'male')
return "gender_male_event";
else if (event.gender == 'female')
return "gender_female_event";
else
return "gender_not_set_event";
}
else {
if (event.shadow_event)
return "virtual_event";
}
};
}
Looking at the markup for the view, the div class “dhx_cal_data” contains no tables when I use the scheduler.BeforeInit.Add(“defineTemplates();”); line.