showLightbox function question

I have a custom form for the scheduler.showLightbox function. I need to handle create and edits slightly differently and am not sure how to detect this.

  • Is there a way to define 2 lightbox functions? 1 for editing record and another for creating

  • With a single lightbox function is there a way to determine if the record Id passed in is a new record or an existing one?

You can check value of scheduler.getState().new_event, if it set to true then this is lightbox for newly created event.

Thank you I think that will work.

I’m still having problems trying to integrate a custom form with the scheduler. My showLightbox function has a form with fields such as text/start/end times for the calendar event. When I dismiss this window how can I save the form fields to the current record so their values are saved when it hits the dataProcessor? For example the DP is being sent a field start_date but I don’t know how to get my form’s start date to transfer to this value.

Are there any demos for this sort of thing? I have done this all before with a grid but scheduler seems to be different.

Check samples\02_customization\16_custom_form.html

[code]function save_form() {
var ev = scheduler.getEvent(scheduler.getState().lightbox_id);
ev.text = html(“description”).value;
ev.custom1 = html(“custom1”).value;
ev.custom2 = html(“custom2”).value;

		scheduler.endLightbox(true, html("my_form"));

This one is called during lightbox closing. It sets data back from form to event object.