What is the method for setting up two distinct lightboxes in one timeline?

What is the method for setting up two distinct lightboxes in one timeline?

Clicking on a button on the toolbar will prompt the first lightbox with different settings to be called, for instance.
When clicked inside the scheduler, the second lightbox will be called as usual.

Thanks for your guidance.

Hello @peuportier,

You can redefine lightbox config manually with resetLightbox method:
https://docs.dhtmlx.com/scheduler/api__scheduler_resetlightbox.html

So the easiest way to achieve your requirement, is to create some flag variable, and change its value in dependence on clicked area(toolbar/scheduler).

So you will be able to change the scheduler config in the onBeforeLightbox event.

The code may look like follows:

let toggle = false;

scheduler.attachEvent("onBeforeLightbox", function(event_id) {
    scheduler.resetLightbox();
    if(!toggle){
        scheduler.config.lightbox.sections = full_lightbox;
    }
    if(toggle){
        scheduler.config.lightbox.sections = restricted_lightbox;
    }
    toggle = false;
    return true;
});

setTimeout(() => {
    document.querySelector("#restArea").addEventListener("mousedown", () => {
        toggle = true;
        scheduler.addEventNow()
    }) 
}, 100)

Here is a demo(different lightbox for click on the Top area, and for events created by click/drag inside the scheduler):
https://snippet.dhtmlx.com/n8y4a3kq

Kind regards,