How to access event data after lightbox is rendered?

Is there a way to access the event record data when editing an existing event from within the lightbox? I’m specifically looking for a way to access the id of the event record when the render() function is called on one of the lightbox custom sections.

Thanks in advance!


You can use

var some = null; scheduler.attachEvent("onBeforeLightbox", function(id){ some = id; return true; });

Now you can use “some” in your custom rendering code.
Beware that normally rendering of form occurs only once, previously used form will be reused for next edit operations ( can be changed by resetLightbox method )

Thanks Stanislav! This works exactly like I wanted. I appreciate the pointer on calling resetLightbox() too.


Hi, I just noticed one side-effect of using resetLightBox. It appears subsequent new lightboxes get added to the DOM without the previous ones being removed. One problem as a result was being able to identify which one to use in my jQuery selectors to operate on the lightbox form data. In my testing it appears that newer lightboxes are added closest to the top of the DOM, so I was wondering if this always the case? For now, something like this: $(".dhx_cal_larea:first") seems to be working.

Also, it seems like another side effect may be that the memory usage from the DOM may increase in applications where lightboxes are rendered frequently without the browser page being refreshed. Is this problematic? Is there an alternative?


Problem confirmed, we will update resetLightbox method to remove old lightboxes from the DOM
As for now you can use

if (scheduler._lightbox) scheduler._lightbox.parentNode.removeChild(scheduler._lightbox); scheduler.resetLightbox();