Our pure JavaScript Scheduler component


Post by tatev »

Hi , i want when event edit modal is open , it gets default value for resourcesField

 listeners: {
      beforeEventEditShow({ eventRecord, editor,source }) {
        editor.autoClose = false;
         editor.widgetMap.resourcesField.value=eventRecord.data.resourceId
        }
      },

Post by tatev »

?


Post by mats »

You mean when creating a new event?


Post by tatev »

Yes


Post by tasnim »

Hi,

Here is an example of how you could achieve it

    listeners : {
        beforeEventEditShow(props) {
            const { eventRecord, editor } = props;
            if (eventRecord.isCreating) {
                editor.widgetMap.resourceField.value = 'r1';
            }
        }
    }

Docs
https://bryntum.com/products/scheduler/docs/api/Scheduler/model/EventModel#property-isCreating
https://bryntum.com/products/scheduler/docs/api/Scheduler/feature/EventEdit#event-beforeEventEditShow

You can test it here https://bryntum.com/products/scheduler/examples/basic/

msedge_O418Su3MTU.gif
msedge_O418Su3MTU.gif (938.02 KiB) Viewed 75 times

Best regards,
Tasnim


Post Reply