enable "add an event" but disable "edit an event"

Hi. I’m wondering if its possible to only create a new event but disable events edition.

I’m aware of read-only mode. Also, I can disable lightbox edition:
scheduler.config.readonly_form = true;

But the problem is that it also blocks events creation.

I’d like a user to be able to create events but not editing them.

Thanks in advance.

Hello.

You could set readonly to events after creation.
See article: docs.dhtmlx.com/scheduler/readon … ificevents

Or you could try to disable all editings with configs.
You could disable resize and move via drag and drop.
See articles:
docs.dhtmlx.com/scheduler/api__s … onfig.html
docs.dhtmlx.com/scheduler/api__s … onfig.html

You could handle onBeforeLightbox event and return false if new event wasn’t created. You could use getState function to find if new event was created.
See articles:
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … state.html

Thank you Sten. I couldn’t figure out how to solve this.

Is there a way to hide the save and delete buttons when editing an event? The methods I’ve tried so far disable both buttons even when creating an event but I need it to be enabled when creating a new one.

Thanks.

Hi,
you can try hiding these buttons using scheduler.config.buttons_left/buttons_right configs. You can detect when the lightbox is about to be opened and modify these configs accordingly
Here is a demo:
docs.dhtmlx.com/scheduler/snippet/146c9261
And related docs
docs.dhtmlx.com/scheduler/api__s … onfig.html
docs.dhtmlx.com/scheduler/api__s … onfig.html
docs.dhtmlx.com/scheduler/api__s … htbox.html
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … state.html