Deactivate default calendar behaviour

Hi,

I use the Cuba Calendar in one of my projects.
It has some default behaviour I want to deactive.

1.) It is possible to click on a day in the week calendar and it opens the “day-view”

2.) It is possible to resize an event

3.) It is possible to move an event

How can I deactivate these features?

Thanks for your help!

Regards
Nico

Hi @nico.kowalczyk1, look at this

Thanks,
I already know the documentation, but none of my problems are pointed there.

I’ll take a look to the implementation of the calendar.

Actually, yes they are:

    addDateClickListener(CalendarDateClickListener listener) - adds listener for date clicks:

    calendar.addDateClickListener(
            calendarDateClickEvent ->
                    notifications.create()
                            .withCaption(String.format("Date clicked: %s", calendarDateClickEvent.getDate().toString()))
                            .show());

    addWeekClickListener() - adds listener for week number clicks.

    addEventClickListener() - adds listener for calendar event clicks.

    addEventResizeListener() - adds listener for event size changing.

    addEventMoveListener() - adds listener for event drag and drop.

    addForwardClickListener() - adds listener for calendar forward scrolling.

    addBackwardClickListener() - adds listener for calendar backward scrolling.

    addRangeSelectListener() - adds listener for calendar range selection.

Everything you want to implement can be done with the mentioned events. Just go into the Controller, hit “subscribe to event” and go to town.

(You don’t have to use the addXListener stuff either, like I said, you can go into the Controller and use the “subscribe to event…” menu. I did.)

3 Likes

Thanks for your advise,

it is now working nearly correctly without changes from my side. It is real strange. Now the listeners work except the DateClickListener, or I don’t understand it correctly.

Thatswhy my question is now: Which event do I have to listen to for one timespot in the calendar (e.g. friday (am)?

Other question: I found a strange log message on server startup. This could maybe be the cause for this strange behaviour.

The widgetset in use does not seem to be built for the Vaadin
version in use. This might cause strange problems - a
recompile/deploy is strongly recommended.
 Vaadin version: 8.9.2-6-cuba
 Widgetset version: 8.9.2-3-cuba

I tried to recompile with gradlew clean build but still the same message. I am working with cuba 7.2.4

Cheers