Hi! I'm trying to set the calendar (i.e. resource) of an event dynamically depending on the name that is selected:
However, while the calendar field visually does change, it's value when submitting the event does not (the default calendar/resource value is submitted):
While changing the calendar manually works correctly:
Please find my code below.
I'm using the change listener to set the value of the resourceField, but as shown above, this seems to only affect the field's value, and not the actual calendar that the event is allocated to.
Can someone please explain how to change the calendar (resource) of an event dynamically?
Thanks a lot!
features : {
eventEdit : {
items : {
nameField : {
type : 'combo',
name : 'name',
ref : 'titelSelect',
label : 'Titel',
valueField : 'name',
displayField : 'name',
listItemTpl : item => StringHelper.xss`<div class="color-box b-sch-${item.eventColor}"></div><div>${item.name}</div>`,
items : [
...
],
listeners : {
change : ({ source : combo, value, eventRecord }) => {
const resourceField = combo.owner.widgetMap.resourceField;
resourceField.value = value;
}
}
},
assistentId : {
weight : 101,
type : 'combo',
name : 'assistentId',
label : 'Assistent',
valueField : 'id',
displayField : 'name',
items : [
...
]
},
resourceField : {
hidden : false,
ref : 'resourceField'
}
}
},
eventTooltip : {
align : 'l-r'
}
}