Minical with Hidden Sections

The sample file 29_changing_lightbox_configurations shows a technique for creating hidden sections by having 2 lightboxes defined as variables and switching between the lightboxes in the “onBeforeLightbox” event.

If the hidden section has a date input, is it possible to attach the MiniCal to the date input field?

I have attempted to do that and cannot get it work.

I am using the method described in the docs for attaching the MiniCal and I can get it to work if I have just one lightbox format, but when I have two lightboxes defined via variables I can’t make it work. It renders the MiniCal sometimes, but not others, and I haven’t managed to track down why yet.

When I make it work with non-hidden sections, I am using the On TemplatesReady event to attach the MiniCal, but when I have two lightboxes, I am trying to attach the MiniCal via the OnBeforeLightbox event.

Is there a more suitable event that I could use to place my attachment code?

Login in 29_changing_lightbox_configurations, calls resetLightbox each time, which fully reconstruct lightbox, which removes previously attached mini calendar.

You can add to end of beforeLightbox handler, after resetting and assigning the new scheme code like next

var lightbox_form = scheduler.getLightbox(); var input = some_logic_to_access_input(); input.onclick = show_minical;

where show_minical - handler which was created in onTemplatesReady

It will restore valid onclick handler after lightbox repainting

Thanks Stanislav.

You’re confirming that I was going in the right direction with my coding. I’ve probably just made a simple mistake that I am overlooking. I’ll recheck what I have done.