Hi,
Here is the code for your ready reference. Also How can we avoid same options of combo box in xml file with different default option selected in each existing appointments? Where can we get the checkbox to be ticked based on its property in xml file?
var format=scheduler.date.date_to_str("%Y-%m-%d %H:%i");
scheduler.templates.tooltip_text = function(start,end,event) {
return “Event: “+event.text+“
Start date: “+format(start)+“
End date: “+format(end);};
var appTypes=this.GetAppTypes()
var appTypesarray=appTypes.split(”*”)
var counter=appTypesarray.length;
var sections= new Array();
var selectout=””
var patient=this.GetPatient();
var chart=this.GetChart();
var provider=this.GetProvider();
for (i=0;i<counter;i++)
{
sections[i] = new Object();
sections[i].key=i;
sections[i].label=appTypesarray[i]
selectout=selectout+”<option "
if (appTypesarray[i]==“APPOINTMENTS”) selectout=selectout+“selected=‘selected’”
selectout=selectout+”>"+appTypesarray[i]+""
}
var selectout=selectout+""
scheduler.locale.labels.timeline_tab = “Provider”
scheduler.locale.labels.section_description=“Appointment Reason”;
scheduler.locale.labels.section_patient=“Patient”;
scheduler.locale.labels.section_time=“Appointment Time”;
scheduler.xy.menu_width = 0;
scheduler.config.hour_size_px = 55;
scheduler.config.multi_day = true;
scheduler.config.event_duration = 15;
scheduler.config.drag_move = true;
scheduler.config.drag_resize = true;
scheduler.config.limit_time_select = true;
scheduler.config.lightbox.sections = [
{name: “description”, height: 0, map_to: “text”, type: “appointmentdetails_editor”, focus: true },
{name:“time”, height:72, type:“time”, map_to:“auto”}
]
scheduler.form_blocks[“appointmentdetails_editor”] = {
render: function(sns) {
var customfields = “”;
customfields += “
”;
customfields += “
Patient |
”;
customfields += “”+patient+" |
";
customfields += “
Chart Number |
”;
customfields += “”+chart+" |
";
customfields += “
Provider |
”;
customfields += “”+provider+" |
";
customfields += “
Appointment Type |
”;
customfields += selectout;
customfields += “ |
Appointment Reason |
”;
customfields += “ |
”;
customfields += “
Confirm Appointment |
”;
customfields += “ |
”;
customfields += “
”;
return customfields;
},
set_value: function(node,value,ev) {
document.getElementById(“txtPatientName”).disabled=true;
document.getElementById(“txtChartNumber”).disabled=true;
document.getElementById(“txtProviderName”).disabled=true;
document.getElementById(“txtConfirmAppointment”).disabled=true;
if (value != “New event”) {
document.getElementById(“txtConfirmAppointment”).disabled=false;
}
},
get_value: function(node, ev) {
//ev.location = node.childNodes[4].value;
document.getElementById(“txtPatientName”).value;
document.getElementById(“txtProviderName”).value;
document.getElementById(“txtAppointmentType”).selectedIndex.value;
document.getElementById(“txtAppointmentReason”).value;
return “Patient:”+document.getElementById(“txtPatientName”).value+" Doctor:"+document.getElementById(“txtProviderName”).value;
},
focus: function(node) {
//var a = node.childNodes[1]; a.select(); a.focus();
}
}