Delete button when creating new event

If I set “scheduler.config.details_on_create = true” the delete button appears on the lightbox to create a new event when it’s not necessary. How can I remove it only in that particular case?

Thanks!

It will work the same as cancel button, so it will do not harm.
Anyway, you can

  • use onBeforeLightbox event
  • from it redefine scheduler.config.buttons_right colleciton ( which is [“dhx_delete_btn”] by default )
  • call resetLightbox
  • return true

Thanks! The following code worked for me.

[code]scheduler.attachEvent(“onBeforeLightbox”, function (event_id){
if (typeof(scheduler.getState().new_event) !== “undefined” && scheduler.getState().new_event !== null)
{
scheduler.config.buttons_right=[];
}
else
{
scheduler.config.buttons_right=[“dhx_delete_btn”];
}

scheduler.resetLightbox();	
return true;

}); [/code]