on the problem of keeping the lightbox hidden

Hello dhtmlx crew

(this concerns Scheduler 2.3, however might also apply to 3.0 - I have not verified the same behaviour on 3.0)

When creating or editing an Event, dhtmlxScheduler will create a lightbox. When closing the Event creation dialog dhtmlxScheduler will only set “display: none” on the lightbox inside the DOM tree and reuse the same lightbox DOM element later.

This decision of keeping the lightbox around in the background and not recreating it every time an Event dialog is needed might have its merits: possibly it was decided upon this solution in order to trade (optimize) space (DOM) utilization against execution time?

However that pattern also has a disadvantage - namely that there is state inside the hidden lightbox that is also present within properties of the scheduler object. When those two states disagre, chaos ensues. Recreating the lightbox every time it is needed would eliminate that situation.

Datapoint: in our project we are filtering the Units [1]. If the filtering changes, the lightbox fails to update its selection of units. (a screenshot is attached to make my example less theoretical)

Our current solution is to do:


every time we change the filtering.


[1] docs.dhtmlx.com/doku.php?id=dhtm … units_view


How do you change list of units? How are they connected with the lightbox (I understand that through select in lightbox but how in code do you use same object for both of them)?

Best regards,