dhtmlxScheduler Problem load in IE
Hi, i have a problem with IE, when scheduler load don´t show the date, but if click in any day or arrows of navigation yes show the data, what it´s the problem, in firefox works fine.
Thanks..
Jorge Arzuaga
If issue still occurs for you - please provide any kind of sample or demo link where it can be reconstructed.
The next is the example... what is doing bad? thanks for all... Jorge Arzuaga
<script type="text/javascript" charset="utf-8">
function scheduler_init() {
scheduler.config.xml_date="%Y-%m-%d %H:%i";scheduler.config.lightbox.sections=[
{name:"description", height:40, map_to:"text", type:"textarea" , focus:true},
{name:"time", height:72, type:"time", map_to:"auto"}
]
scheduler.config.first_hour=7;
scheduler.config.icons_select = ["icon_details","icon_delete"];
scheduler.init("div_scheduler",null,"month");
scheduler.load("js/php/complete.php?tipo=scheduler");
scheduler.setCurrentView(new Date(),"month"); var format = "%Y-%m-%d %H:%i";
scheduler.attachEvent("onEventChanged", function(event_id,event_object){
start_date = scheduler.getEvent(event_id).start_date;
var convert = scheduler.date.date_to_str(format,false);
start_date = convert(start_date);
end_date = scheduler.getEvent(event_id).end_date;
var convert = scheduler.date.date_to_str(format,false);
end_date = convert(end_date);
texto = scheduler.getEvent(event_id).text;
if(event_id > 0){
UpdateAjaxFull2("fecha_inicial,fecha_final,texto",start_date+","+end_date+","+texto,"p_calendario_eventos"," evento_id="+event_id,"default","");
scheduler.editStop(true);
}
return true;
});
scheduler.attachEvent("onEventAdded", function(event_id,event_object){
start_date = scheduler.getEvent(event_id).start_date;
var convert = scheduler.date.date_to_str(format,false);
start_date = convert(start_date);
end_date = scheduler.getEvent(event_id).end_date;
var convert = scheduler.date.date_to_str(format,false);
end_date = convert(end_date);
texto = scheduler.getEvent(event_id).text;
var sql = " fecha_inicial='"+start_date+"', fecha_final='"+end_date+"', texto='"+texto+"' ";
if(substr(event_id,0,10) == "new_event_"){
var new_event_id = InsertAjaxFull("fecha_inicial,fecha_final,texto",start_date+","+end_date+","+texto,"p_calendario_eventos","");
scheduler.changeEventId(event_id, new_event_id);
scheduler.editStop(true);
}
return true;
});scheduler.attachEvent("onBeforeEventDelete", function(event_id,event_object){
scheduler.editStop(true);
if(event_id > 0){
scheduler.deleteEvent(event_id,true);
DeleteAjaxSI("p_calendario_eventos"," evento_id="+event_id,"");
scheduler.editStop(true);
}
return true;
});}
</script>
<div id="div_scheduler" class="dhx_cal_container" style="width:100%; height:100%;position:absolute">
<div class="dhx_cal_navline">
<div class="dhx_cal_prev_button"> </div>
<div class="dhx_cal_next_button"> </div>
<div class="dhx_cal_today_button"></div>
<div class="dhx_cal_date"></div>
<div class="dhx_cal_tab" name="day_tab" style="right:204px;" ></div>
<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
</div>
<div class="dhx_cal_header"></div>
<div class="dhx_cal_data"></div>
</div>
<script type="text/javascript" charset="utf-8">
scheduler_init();
</script>
Code looks correct , and must not cause any issues
Please try to update it in the next way
a) change
scheduler.load("js/php/complete.php?tipo=scheduler");
scheduler.setCurrentView(new Date(),"month");
as
scheduler.load("js/php/complete.php?tipo=scheduler",function(){
scheduler.setCurrentView(new Date(),"month");
});
loading is async. and with updated syntax, command will be called exactly after data loading.
b) in current version, onEventAdded event may fire when event loaded from xml, which is not necessary in your case.
scheduler.attachEvent("onEventAdded", function(event_id,event_object){
if (this._loading) return true; //this line need to be added
start_date = scheduler.getEvent(event_id).start_date;
Yes, its works... thank you very much.