Detecting 'New Event' or 'Existing Event' onBeforeLightbox

Hi,

When I create new event, or clicking existing event to open detail form,
I want to detect whether this is new event or existing event.
So if new event, my custom section field should be enabled
And if existing event, my custom field should be read only.

I guess I should use onBeforeLightbox event and form_blocks[‘myfield’].set_value,
But I don’t know any more.

lightbox form is not well suited for dynamical changes, but next can be done

from onBeforeLightbox check
scheduler.getState().new_event
based on its value you can set new
scheduler.config.lightbox
configuration and call
scheduler.resetLightbox();
to apply it