Dynamic loading of lightbox button

Hello,

Is there any way to add a button to the lightbox in a dynamic way: depending on event data. I tried to use multiple buttons_left config. But this doesn’t work, the configuration is called juste once.

So I would like to do something like this:
scheduler.attachEvent(“onBeforeLightbox”, function (id){
ev = scheduler.getEvent(id);

	//We handle the display of the submitWorkflow button
	if(ev.conge && !ev.conge.processStep) {
		scheduler.config.buttons_left=["dhx_save_btn","dhx_cancel_btn","submit_process_step_button"];
	} else {
		scheduler.config.buttons_left=["dhx_save_btn","dhx_cancel_btn"];
	}

}

This doesn’t work as I said.

Thanks !

hi,
Go for custom light box . :nerd:

Hello,
you need to reset the lightbox after applying new settings (by default it reuses an old html)
docs.dhtmlx.com/scheduler/api__s … htbox.html

Check this example, double click on different events
docs.dhtmlx.com/scheduler/snippet/3c2b4f96

Yeah I would like to avoid to use the custom_lightbox as much as possible if I can do what I need to do with the existing one ^^

The resetLightbox() method works like a charm ! Thank you very much !