Our powerful JS Calendar component


Post by mackopperfield »

When using the default resourceField described here https://bryntum.com/products/calendar/docs/guide/Calendar/customization/eventedit#default-fields it doesn't seem like it's possible to set this to not auto select the first resource.

    eventEditFeature: {
      items: {
        ...
        resourceField: {
          type: "combo",
          label: "Dispatch",
          multiSelect: true,
          value: [],
          weight: 700,
        },

I can get around it via beforeEventEditShow but feels like this may be a bug

beforeEventEditShow: (props: any) => {
        props.editor.widgetMap.resourceField.value = [];
      },

Post by marcio »

Hey,

Thanks for reaching out.

I was able to reproduce and created a ticket to fix that https://github.com/bryntum/support/issues/9640, as it sounds like a reasonable action.

Pleas watch the ticket to receive live updates.

Best regards,
Márcio


Post by Animal »

Do you mean that a default resource is selected when you create an event?

This is configurable here: https://bryntum.com/products/calendar/docs/api/Calendar/mixin/CalendarStores#config-defaultCalendar

Screenshot 2024-07-23 at 07.05.14.png
Screenshot 2024-07-23 at 07.05.14.png (219.74 KiB) Viewed 163 times

Post by mackopperfield »

Oh I see thanks! I think it still makes sense to be able to at least override that and set no default resource for the field itself in the field config (rather than have it opaquely be a snowflake field) but this works. I'll also say that I would've never found this field without you pointing me to it, in most places in the docs "Calendars" seem to be referred to as "Resources". Appreciate the assistance regardless.


Post Reply