Discuss anything related to web development but no technical support questions


Post by pekdon »

I'm trying to create a new custom field in the Event Editor, I've followed the steps from the documentation:
https://bryntum.com/products/scheduler/docs/guide/Scheduler/customization/eventedit#add-custom-widgets

const scheduler = new Scheduler({
    features : {
        eventEdit : {
            items : {
                equipment : {
                    // custom field configuration
                },
                volume : {
                    // custom field configuration
                }
            }
        }
    },
    listeners : {
        beforeEventEditShow({ editor, eventRecord }) {
            const
                equipmentCombo = editor.widgetMap.equipment,
                volumeField = editor.widgetMap.volume;

        // update data in combo list
        equipmentCombo.items = this.equipmentStore.getRange();
        // update field visibility state
        volumeField.hidden = !eventRecord.hasVolume;
    }
}
});

However, how am I supposed to know what the model that gets return from the following method call is structured?

this.equipmentStore.getRange()

My use case that I'm trying to implement is I need a dropdown field in the event editor where the values are gonna be objects with an id and a value field.

Can someone help me out, or point me in the right direction?


Post by pekdon »

I've solved my own issue!

For anyone else who's stumbled over this issue you can just go here!

https://bryntum.com/products/scheduler/docs/api/widgets/Core/widget/Combo


Post by Animal »

You don't need to dynamically set equipmentCombo.items = this.equipmentStore.getRange(); everytime you show the editor.

Just configure the equipment combo with store : this.equipmentStore.chain()


Post Reply