Premium support for our pure JavaScript UI components


Post by jnarowski »

Good afternoon!

We're trying to build the recurring events feature on our Calendar but we're having a couple of issues trying to make this work

Our strategy is to enable the recurrenceCombo for all modes and then catch the beforeEventEdit event to hide it when the resource is already created (internal requirement)

So this is how our eventEditFeature looks like:

eventEditFeature: {
      items: {
        allDay: false,
        resourceField: {
          multiSelect: false,
        },
      }
    },
 }

By not modifying anything related to the recurring feature we expect it to be displayed in the Calendar but this is only true for the MONTH view, the DAY and WEEK view doesn't show the recurrenceCombo at all.

But then focusing only in the MONTH view which is the one that works, we want to prevent this combo to be displayed for already created events so we have this listener

const handleBeforeEventEdit = ({ eventRecord, eventEdit }) => {
  if (!eventRecord.isCreating) {
    // This is not working
    eventEdit.editorConfig.items.recurrenceCombo = false
  }
}

But this doesn't work, the recurrence combo shows up also for event records which isCreating false. How could we capture and hide this combo from the event listener?

Thanks!

Attachments
bryntum-calendar-vite.zip
(57.21 KiB) Downloaded 16 times

Post by alex.l »

Hi,

We have guide about EventEditor customization here https://bryntum.com/products/calendar/docs/guide/Calendar/customization/eventedit
A part about update fields state is here https://bryntum.com/products/calendar/docs/guide/Calendar/customization/eventedit#update-custom-fields-state-and-data

Configs cannot be changed at runtime, only before init. You already used correct event and correct approach with handleBeforeEventEditShow handler and using widgetMap. To hide widget please set https://bryntum.com/products/calendar/docs/api/Scheduler/view/recurrence/field/RecurrenceCombo#property-hidden property.

All the best,
Alex


Post Reply