I’m changing end_date in the lightbox when a user selects a certain option from a dropdown menu.
(Not the dates dropdown, this is a custom dropdown I put in).
scheduler.setEventEndDate(event_id, my_end_date);
When the dropdown changes the date and setEventDate is called, the scheduler display updates but the date fields in the lightbox stay the same. How do I get the select options to change to reflect the new end date?
var sections = scheduler.config.lightbox.section;
var time_section = sections[sections.length-1]; // if time is the last section
var node = document.getElementById(time_section.id).nextSibling;
var block = scheduler.form_blocks[time_section.type];
block.set_value.call(this, node, event[time_section.map_to], event, time_section); // note that event - is event object variable
It should update both start and end dates.
I made a mistype in my previous code, here’s sample:
[code] scheduler.attachEvent(“onLightbox”, function(event_id){
var ev = scheduler.getEvent(event_id); // got event object
// creating new dummy end date
var nend = new Date(ev.end_date);
nend.setHours(nend.getHours() + 3);
scheduler.setEventEndDate(event_id, nend); // changing event end_time to it
// updating lightbox section
var sections = scheduler.config.lightbox.sections;
var time_section = sections[sections.length - 1]; // if time is the last section
var node = document.getElementById(time_section.id).nextSibling;
var block = scheduler.form_blocks[time_section.type];
block.set_value.call(this, node, ev[time_section.map_to], ev, time_section); // note that event - is event object variable
});[/code]