Hi support,
I'm trying the schedule control with resources, but I have difficulties in saving the resources attached to an event.
I have activated multiple resources.
The control is defined as:
var scheduleObj = new ej.schedule.Schedule({
width: '100%',
height: '700px',
rowAutoHeight: true,
allowDragAndDrop: false,
firstDayOfWeek: 1,
timezone: 'Europe/Berlin',
views: [{option: 'Month', interval: 6}],
selectedDate: new Date(2020, 0, 1),
resources: [{
field: 'resourceid', title: 'Resource',
name: 'Persongroups', allowMultiple: true,
dataSource: resourceData,
query: csrfQuery,
textField: 'Caption', idField: 'Id', colorField: 'Color'
}],
eventSettings: {
dataSource: calendarData,
query: csrfQuery,
template: '#apptemplate'
}
});
scheduleObj.appendTo('#Schedule');
With one resource selected, the request to the backend is:
{"changed":[{"Id":"1","Subject":"Test2","Location":"Berlin","StartTime":"2019-12-27T23:00:00.000Z","EndTime":"2020-01-03T23:00:00.000Z","IsAllDay":"0","Guid":"c8b7018d-8f58-89db-9a72-1dabef78b43a","StartTimezone":null,"EndTimezone":null,"resourceid":"5","RecurrenceRule":null}],"added":[],"deleted":[],"action":"batch","params":{"_csrf":"_FeDO2_ZE_a2JTi5taNkUKvwl121f0QCAoJDSjk7VBrOG-BVGYxjsP9xff39xxUg48XgL9AgCUBT1AI7ZgJjbg==","StartDate":"2019-12-29T23:00:00.000Z","EndDate":"2020-07-05T22:00:00.000Z"},"_csrf":"_FeDO2_ZE_a2JTi5taNkUKvwl121f0QCAoJDSjk7VBrOG-BVGYxjsP9xff39xxUg48XgL9AgCUBT1AI7ZgJjbg==","StartDate":"2019-12-29T23:00:00.000Z","EndDate":"2020-07-05T22:00:00.000Z"}
But if I add two resources, two requests are sent:
First:
{"changed":[{"Id":"1","Subject":"Test2","Location":"Berlin","StartTime":"2019-12-27T23:00:00.000Z","EndTime":"2020-01-03T23:00:00.000Z","IsAllDay":"0","Guid":"c8b7018d-8f58-89db-9a72-1dabef78b43a","StartTimezone":null,"EndTimezone":null,"resourceid":"3","RecurrenceRule":null}],"added":[],"deleted":[],"action":"batch","params":{"_csrf":"_FeDO2_ZE_a2JTi5taNkUKvwl121f0QCAoJDSjk7VBrOG-BVGYxjsP9xff39xxUg48XgL9AgCUBT1AI7ZgJjbg==","StartDate":"2019-12-29T23:00:00.000Z","EndDate":"2020-07-05T22:00:00.000Z"},"_csrf":"_FeDO2_ZE_a2JTi5taNkUKvwl121f0QCAoJDSjk7VBrOG-BVGYxjsP9xff39xxUg48XgL9AgCUBT1AI7ZgJjbg==","StartDate":"2019-12-29T23:00:00.000Z","EndDate":"2020-07-05T22:00:00.000Z"}
Second:
{"changed":[],"added":[{"Id":"1a3a7295-4859-9018-bb5c-29b10159b172","Subject":"Test2","Location":"Berlin","StartTime":"2019-12-27T23:00:00.000Z","EndTime":"2020-01-03T23:00:00.000Z","IsAllDay":"0","Guid":"c8b7018d-8f58-89db-9a72-1dabef78b43a","StartTimezone":null,"EndTimezone":null,"resourceid":"5","RecurrenceRule":null,"RecurrenceException":null,"RecurrenceID":null}],"deleted":[],"action":"batch","params":{"_csrf":"_FeDO2_ZE_a2JTi5taNkUKvwl121f0QCAoJDSjk7VBrOG-BVGYxjsP9xff39xxUg48XgL9AgCUBT1AI7ZgJjbg==","StartDate":"2019-12-29T23:00:00.000Z","EndDate":"2020-07-05T22:00:00.000Z"},"_csrf":"_FeDO2_ZE_a2JTi5taNkUKvwl121f0QCAoJDSjk7VBrOG-BVGYxjsP9xff39xxUg48XgL9AgCUBT1AI7ZgJjbg==","StartDate":"2019-12-29T23:00:00.000Z","EndDate":"2020-07-05T22:00:00.000Z"}
The second one is a very strange request.
Where does this Id come from? (1a3a7295-4859-9018-bb5c-29b10159b172)
I have no ids like this in my database, not in the events and not in the resources.
How can I select the event which I have to update, if I don't have an id?
And there is another thing:
It's a pity that the the control requires at least one resource (if the resource array is set in the configuration) otherwise the data is not sent.
But the user is not informed. The edit form closes but no request is sent.
And also the display is not correct. (a single click always shows a resource even if no one is attached).
I'm using the 18-2-48patch of ej2.
Regards,
Stephan