When I use the .load() to get my data, I use a callback on the Load2 to retrieve IDs and then put them on readonly (+coloring).
What happens is this : the callback gets the IDs from one or another .load() randomly… So, sometimes, the coloring and readonly are triggered for the Load1 instead of the load2, and this is random, I can’t figure out why this happens.
$(function() {
scheduler.attachEvent("onLightbox", function (id){
console.log(scheduler.getEvent(id));
});
scheduler.config.lightbox.sections = [
{name: "prestation", height: 40, type: "select", map_to: "type_code", options: types},
{name: "related", height: 40, type: "select", map_to: "employee_id", options: employees},
{name: "time", height: 72, type: "time", map_to: "auto"},
{name: "note", height: 130, map_to: "note", type: "textarea"}
];
// Load1
scheduler.load(url+"/attendances/list", “json”);
// Load2
scheduler.load(url+"/calendar/holidays/list", "json", function(){
for (var i in this._events){
scheduler.getEvent(i).readonly = true;
scheduler.getEvent(i).color = "#ccf1ff";
scheduler.updateEvent(i);
}
});
});