Unable to Save Combo Box value in Lightbox using OnEventSave

Hello,

I am validating ComboxBox and Calendar for my application. I have custom fields in Lightbox (primary and Secondary). These are comboxbox. When user select these fields, i would like to capture the event (onEventSave) and would like to read (id, start_date,end_date, primary,secondary). Could you please help me with onEventSave function??

scheduler.locale.labels.section_primary = “Primary On Call:”;
scheduler.locale.labels.section_secondary = “Secondary On Call:”;

var emailsArray = [];
for(var i=0; i < emails.length; i++)
emailsArray.push({key: i, label: emails[i]});

scheduler.config.lightbox.sections=[
{ name:“primary”, options: emailsArray, map_to:“combo_select”, type:“combo”, image_path: “…/…/…/dhtmlxcombo/codebase/imgs/”, filtering: true },
{ name:“secondary”, options: emailsArray, map_to:“combo_select”, type:“combo”, image_path: “…/…/…/dhtmlxcombo/codebase/imgs/”, filtering: true },
{ name:“time”, height:72, type:“time”, map_to:“auto”}
];

scheduler.attachEvent(“onEventSave”,function(id,data,is_new_event){
??? How to get value of Fields Primary and Secondary here
}

change config as

{ name:"primary", options: emailsArray, map_to:"combo_select1", type:"combo", image_path: "../../../dhtmlxcombo/codebase/imgs/", filtering: true }, { name:"secondary", options: emailsArray, map_to:"combo_select2", type:"combo", image_path:

and now you will be able to use

scheduler.attachEvent("onEventSave",function(id,data,is_new_event){ alert(data.combo_select1); alert(data.combo_select2); }

Hi,

I added following code but i get only key but i need label. How do i get label?

var emailsArray = [];
for(var i=0; i < emails.length; i++)
emailsArray.push({key: i, label: emails[i]});

scheduler.attachEvent(“onEventSave”,function(id,data,is_new_event){
alert(data.combo_select1); <---------------- 1
alert(data.combo_select2);
}

Hello,

I have a custom fields in section. I could save the values using combobox. My dilemma is following

  1. User creates Events
  2. Event is saved in Database using Ajax Call ( Using Python backend)
  3. When scheduler is opened again, Events load from database( Scheduler.parse(json))
  4. How do i set default values for primary/secondary combobox as values parsed from Database?

Is there a way to add “EDIT” button like SAVE/DELETE/CANCEL in Event window. I would like to show Non Editable Text (primary/Secondary) for a pre-loaded event(from Database, scheduler.parse(json)) and when user clicks EDIT, He should see combo-box. Could you please help?

scheduler.config.lightbox.sections=[
{name:“description”, height:130, map_to:“text”, type:“textarea” , focus:true},
{ name:“primary”, options: emailsArray, map_to:“combo_select1”, type:“combo”, image_path: “…/…/…/dhtmlxcombo/codebase/imgs/”, filtering: true },
{ name:“secondary”, options: emailsArray, map_to:“combo_select2”, type:“combo”, image_path: “…/…/…/dhtmlxcombo/codebase/imgs/”, filtering: true },
{ name:“time”, height:72, type:“time”, map_to:“auto”}
];

scheduler.data_attributes = function(){
return [
[“id”],
[“primary”],
[“secondary”],
[“start_date”,scheduler.templates.xml_format],
[“end_date”,scheduler.templates.xml_format]
]
}