Hello
I am great difficulties with the timeline_cell_class templates.
I am trying to display in each cell a different color if my unit is available or not.
To know if it is available I call a webservice that send me the information for the day (this unit can be available or not, and if available, I can have up to 3 periods of time where he is available).
My first try :
scheduler.templates.timeline_cell_class =function(event_list,time,ressource_timeline) {
if(ressource_timeline.id_codcal!='') {
return "AVAIL";
}
else
return "NOTAVAIL";
}
With this simple code no problems in IE or firefox. If the id_codcal have a value it available and else it is unavailable.
but with the following :
scheduler.templates.timeline_cell_class =function(event_list,time,ressource_timeline) {
if(ressource_timeline.id_codcal!='') {
$.ajax({ url: varurl+"CalAvailability",
dataType: 'json',
data : $.param({'ID_CODCAL': ressource_timeline.id_codcal,'DAY':time.getDate(),'MONTH':time.getMonth()+1,'YEAR':time.getFullYear()}),
async: false});
return "AVAIL";
}
else
return "NOTAVAIL";
}
This webservice sends back a json object containing the information I would like to test (available or not, and the differents hours of availibility).
I have removed the unnecessary code, as the simple fact to add the ajax call seems to lose IE completely.
If I try in firefox it is OK, the code is completed with sucess.
But in IE, it seems to go in some kid of deadlock as I usually have to call the task manager to kill the task.
Note that I don’t even try to do something with the result I just try to have my result (as I have tried to advance a bit more with forefox I have done something to put the result of my calls in a array so that I don’t have to launch the ajax call for each cells, I tried with IE after having completed the work in firefox but the problem is the same)
Am I doing something wrong (it seems to me that as it works with success with firefox, it should be ok), but…
Thanks in advance for your help.