Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jennifer on Jul 20, 2009 16:58
open dhtmlx forum
Scheduler

I am having issues with an error in IE. It works fine in FireFox but I get the following error in ie (Invalid Argument on Line 2 Char 28676). When I run a script debugger on it in ie it points to the dhtmlxscheduler_6_25.js script which is what you sent me to use on an earlier bug. Any help would be appreciated.

Thanks so much,

Jen

The code is as follows:

<div style='position:relative;height:520px;width:95%;z-index:0;' >
<br><br>
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:95%;'>
<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>
</div>

<script>

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:"details", height:130, type:"textarea", map_to:"cal_event_desc" },
{name:"time", height:72, type:"time", map_to:"auto"},
{name:"priority", height:40, type:"select", map_to:"cal_event_priority",
options:[
{key:1, label:"Normal"},
{key:2, label:"Moderate"},
{key:3, label:"Critical"}
]
},
{name:"is_recurring", height:40, type:"select", map_to:"is_recurring",
options:[
{key:1, label:"This time only"},
{key:2, label:"Daily"},
{key:3, label:"Weekly"},
{key:4, label:"Every 2 Weeks"},
{key:5, label:"Monthly"},
{key:6, label:"Quarterly"}
]
},
{name:"recurrence_span", height:40, type:"select", map_to:"recurrence_span",
options:[
{key:1, label:"The next month"},
{key:2, label:"The next 6 weeks"},
{key:3, label:"The next 3 months"},
{key:4, label:"The next 6 months"},
{key:5, label:"The next year"}
]
},
{name:"recurrence_update_opts", height:40, type:"select", map_to:"recurrence_update_opts",
options:[
{key:0, label:"Just this event"},
{key:1, label:"All recurring events"}
]
},
{name:"has_reminder", height:40, type:"select", map_to:"has_reminder",
options:[
{key:1, label:"no reminder"},
{key:2, label:"5 minutes before"},
{key:3, label:"10 minutes before"},
{key:4, label:"15 minutes before"},
{key:5, label:"20 minutes before"},
{key:6, label:"30 minutes before"},
{key:7, label:"45 minutes before"},
{key:8, label:"1 hour before"},
{key:9, label:"2 hours before"},
{key:10, label:"3 hours before"},
{key:11, label:"4 hours before"},
{key:12, label:"5 hours before"},
{key:13, label:"6 hours before"},
{key:14, label:"7 hours before"},
{key:15, label:"8 hours before"},
{key:16, label:"9 hours before"},
{key:17, label:"10 hours before"},
{key:18, label:"11 hours before"},
{key:19, label:"12 hours before"},
{key:20, label:"18 hours before"},
{key:21, label:"1 day before"},
{key:22, label:"2 days before"},
{key:23, label:"3 days before"},
{key:24, label:"4 days before"},
{key:25, label:"5 days before"},
{key:26, label:"1 week before"},
{key:27, label:"2 weeks before"},
{key:28, label:"1 month before"}
]
}
]

scheduler.config.hour_date="%h:%i %A";
scheduler.locale.labels.section_description="Event Title";
scheduler.locale.labels.section_details="Event Details";
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.locale.labels.section_priority="Event Priority";
scheduler.locale.labels.section_is_recurring="This event reoccurs...";
scheduler.locale.labels.section_recurrence_update_opts="Make changes to recurring events...";
scheduler.locale.labels.section_recurrence_span="For the next...";
scheduler.locale.labels.section_has_reminder="Email me a reminder of this event...";

scheduler.init('scheduler_here',null,"week");

scheduler._els["dhx_cal_data"][0].scrollTop = scheduler.config.hour_size_px*8;

scheduler.form_blocks.textarea.set_value=function(node,value,ev){
node.firstChild.value=value||"";
node.style.display=ev.disabled?"none":"";
scheduler.setLightboxSize();
}

scheduler.templates.event_class=function(start,end,event){
if (event.cal_event_priority == 1) //if date in past
return "priority_one_event"; //then set special css class for it
else if (event.cal_event_priority == 3) //if date in past
return "priority_normal_event"; //then set special css class for it
else if (event.cal_event_priority == 2) //if date in past
return "priority_medium_event"; //then set special css class for it
}

scheduler.load("/media/dhtmlx/dhtmlxScheduler/samples/events.php?user_id=3&uid="+scheduler.uid());

var dp = new dataProcessor("/media/dhtmlx/dhtmlxScheduler/samples/events.php?user_id=3");
dp.init(scheduler);


Answer posted by Support on Jul 21, 2009 06:43
>><div style='position:relative;height:520px;width:95%;
Is the parent container of the DIV has some width defined on moment of initialization?
The code which you are using looks correct and must not cause the problem, the only possible issue - zero size of container, which can occurs if parent container has not any width defined on moment of scheduler initialization.
Answer posted by jennifer on Jul 26, 2009 13:17
Okay.... I can see this being the issue but anything I change to make sure the size of the container is set doesn't seem to affect the outcome.  The one thing I can think of is that this issue started occuring when I moved the init function from the header using an onload event in the body tag.  Due to our system set up doing it this way is not an option and so it is in the body of the code as shown below.  Where and what should I change or add:

<?php include_once "site_header.php"; ?>

<div style='position:relative;height:520px;width:95%;z-index:0;' >
<br><br>
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:95%;'>
<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>
</div>

<script>

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:"details", height:130, type:"textarea", map_to:"cal_event_desc" },
{name:"time", height:72, type:"time", map_to:"auto"},
{name:"priority", height:40, type:"select", map_to:"cal_event_priority",
options:[
{key:1, label:"Normal"},
{key:2, label:"Moderate"},
{key:3, label:"Critical"}
]
},
{name:"is_recurring", height:40, type:"select", map_to:"is_recurring",
options:[
{key:1, label:"This time only"},
{key:2, label:"Daily"},
{key:3, label:"Weekly"},
{key:4, label:"Every 2 Weeks"},
{key:5, label:"Monthly"},
{key:6, label:"Quarterly"}
]
},
{name:"recurrence_span", height:40, type:"select", map_to:"recurrence_span",
options:[
{key:1, label:"The next month"},
{key:2, label:"The next 6 weeks"},
{key:3, label:"The next 3 months"},
{key:4, label:"The next 6 months"},
{key:5, label:"The next year"}
]
},
{name:"recurrence_update_opts", height:40, type:"select", map_to:"recurrence_update_opts",
options:[
{key:0, label:"Just this event"},
{key:1, label:"All recurring events"}
]
},
{name:"has_reminder", height:40, type:"select", map_to:"has_reminder",
options:[
{key:1, label:"no reminder"},
{key:2, label:"5 minutes before"},
{key:3, label:"10 minutes before"},
{key:4, label:"15 minutes before"},
{key:5, label:"20 minutes before"},
{key:6, label:"30 minutes before"},
{key:7, label:"45 minutes before"},
{key:8, label:"1 hour before"},
{key:9, label:"2 hours before"},
{key:10, label:"3 hours before"},
{key:11, label:"4 hours before"},
{key:12, label:"5 hours before"},
{key:13, label:"6 hours before"},
{key:14, label:"7 hours before"},
{key:15, label:"8 hours before"},
{key:16, label:"9 hours before"},
{key:17, label:"10 hours before"},
{key:18, label:"11 hours before"},
{key:19, label:"12 hours before"},
{key:20, label:"18 hours before"},
{key:21, label:"1 day before"},
{key:22, label:"2 days before"},
{key:23, label:"3 days before"},
{key:24, label:"4 days before"},
{key:25, label:"5 days before"},
{key:26, label:"1 week before"},
{key:27, label:"2 weeks before"},
{key:28, label:"1 month before"}
]
}
]

scheduler.config.hour_date="%h:%i %A";
scheduler.locale.labels.section_description="Event Title";
scheduler.locale.labels.section_details="Event Details";
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.locale.labels.section_priority="Event Priority";
scheduler.locale.labels.section_is_recurring="This event reoccurs...";
scheduler.locale.labels.section_recurrence_update_opts="Make changes to recurring events...";
scheduler.locale.labels.section_recurrence_span="For the next...";
scheduler.locale.labels.section_has_reminder="Email me a reminder of this event...";

scheduler.init('scheduler_here',null,"week");

scheduler._els["dhx_cal_data"][0].scrollTop = scheduler.config.hour_size_px*8;

scheduler.templates.event_class=function(start,end,event){
if (event.cal_event_priority == 1) //if date in past
return "priority_one_event"; //then set special css class for it
else if (event.cal_event_priority == 3) //if date in past
return "priority_normal_event"; //then set special css class for it
else if (event.cal_event_priority == 2) //if date in past
return "priority_medium_event"; //then set special css class for it
}

scheduler.load("/media/dhtmlx/dhtmlxScheduler/samples/events.php?user_id=3&uid="+scheduler.uid());

var dp = new dataProcessor("/media/dhtmlx/dhtmlxScheduler/samples/events.php?user_id=3");
dp.init(scheduler);

<?php include_once "site_footer.php"; ?>


Answer posted by Support on Jul 27, 2009 02:08
You can try to change your code as


<script>
dhtmlxEvent(window,"load",function(){
     scheduler.config.xml_date="%Y-%m-%d %H:%i";
     ...
    dp.init(scheduler);
}

In such case , even if script itself placed inside the body, it will fire only after document loading.