Hello,
Using openEditor and saving is adding the event to the wrong group
<ejs-schedule
:eventClick="onEventClick"
:group="{resources: ['inspectors'], enableCompactView: false}"
...
<e-resource
:allowMultiple='allowMultiple'
:dataSource='inspectors'
field='InspectorId'
idField='id'
name='inspectors'
textField='display_name'
title='Inspector'
>
</e-resource>
onEventClick(event) {
// If this is an availability event then we don't allow it
// to be edited, we create a new event instead
if (event.event.EventType !== 1) {
return
}
event.cancel = true
const newEvent = {
startTime: event.event.StartTime,
endTime: event.event.EndTime,
subject: event.event.Subject,
inspectorId: event.event.InspectorId, // <----- I need the event to belong to the correct group
}
this.scheduler.openEditor(newEvent, 'Add')
},
When I click the even that is read only, I want a modal to pop up with the same details prefilled (that works, mostly) and when I click save, it saves the event to the correct group (inspectors).
However, when I save, the event is saved to whichever inspector is shown first
Disregard.
I needed
const newEvent = {
StartTime: event.event.StartTime,
EndTime: event.event.EndTime,
Subject: event.event.Subject,
InspectorId: event.event.InspectorId,
}
this.scheduler.openEditor(newEvent, 'Add', true)
Based on your shared code snippet, we have prepared a sample with openEditor and the events are saved properly to the respective groups. Please find the sample below.
Sample: https://codesandbox.io/s/vue-openeditor-issue-forked-7501h2?file=/src/App.vue
Kindly try the above sample and if the issue persists, could you please replicate it in our shared sample and share the issue screenshot to validate further at our end?
Hello Vengatesh,
Thank you but your code sample doesn't work correctly. I have corrected it here:
https://codesandbox.io/s/vue-openeditor-issue-forked-wi1n30?file=/src/App.vue
You need "true" in openEditor and capitalize the first letter of the properties of the newEvent object
Thanks! Please close this question.
Hi Ronald,
Thanks for the update.
Please get in touch with us if you need any further assistance.
Regards,
Vengatesh