Custom field

I am new to this, so having a bit of trouble here. I created 2 customs fields, which does display in the lightbox, the problem I have is that it does not display in the calendar view.


The descrition does display but Vakt 1 and vakt 2 does not display, where and how do I need to make the changes so it does display.

any help will be great

Check
docs.dhtmlx.com/doku.php?id=dhtm … ng_content

Thank you, but on which page must I actually look to find this code? as it does not say there.

Just add after scheduler init something like

scheduler.templates.event_text=function(start,end,event){ return "Text:<b> "+event.text+"</b><br>"+event.vakt1; //where vakt1 - value from map_to in lightbox config }

If we talking about plugin - check templates section in the scheduler’s admin page

thank you, again.

I am using wordpress and must say I am still a bit confused as to which php page that is on? in the event-calendar-sheduler folder is codebase and mce_scheduler folders with some other php pages, and codebase has some folders under it again…any idea what the php page is called I need to edit?

It is not the file
Login in admin part of WP and select scheduler from side menu

docs.dhtmlx.com/doku.php?id=dhtm … #templates

Hi All,

I have 6 custom fields in my lightbox 4 text fields (name, number, provider and reason), 1 dropdown (type) and 1 checkbox(confirm). These are being displayed in the lightbox correctly when creating a new event and when storing them to the database. But my question is how to populate these custom fields in the xml file so that they are displayed in the lightbox when editing the existing event. If the checkbox is checked, when event was created and saved, then it shlould be checked when editing at a later date and if a value is selected from drop-down then same should be default selected when editing at later date although other options should be available for selection if it needs to be changed. Does anyone have any sample xml file which shows how the custom text fields, checkbox and drop-down are to be populated?

Also, How can I get the custom field ‘Provider’ to be one of the view on the calendar?

Any help will be appreciated.

Hello,

Have you added all those fields in the admin’s section or somehow yourself?
By default all fields which were created in the admin’s section are saved to the database and values are fetched during loading (and later on displayed in the lightbox).

Best regards,
Ilya

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 += “";
customfields += “";
customfields += “";
customfields += “”;
customfields += “”;
customfields += “
Patient ”;
customfields += “”+patient+"
Chart Number ”;
customfields += “”+chart+"
Provider ”;
customfields += “”+provider+"
Appointment Type ”;
customfields += selectout;
customfields += “
Appointment Reason ”;
customfields += “
Confirm Appointment ”;
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();
}
}