Hi,
we are using the scheduler component in an asp.net core application. We have customized the editortemplate to:
<script id="EventEditorTemplate" type="text/template">
<table class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">@DisplayName.CareProvider</td>
<td colspan="4">
<span id="teammembername"></span>
</td>
</tr>
<tr>
<td class="e-textlabel">@DisplayName.Location</td>
<td colspan="4">
<input type="text" id="LocationId" name="LocationId" class="e-field" style="width: 100%">
</td>
</tr>
<tr>
<td class="e-textlabel">@DisplayName.AppointmentType</td>
<td colspan="4">
<input id="AppointmentTypeId" class="e-field" type="text" name="AppointmentTypeId" />
</td>
</tr>
<tr>
<td class="e-textlabel">@DisplayName.From</td>
<td colspan="4">
<input id="StartTime" class="e-field" type="text" name="StartTime" />
</td>
</tr>
<tr>
<td class="e-textlabel">@DisplayName.To</td>
<td colspan="4">
<input id="EndTime" class="e-field" type="text" name="EndTime" />
</td>
</tr>
<tr>
<td colspan="4">
<div id='RecurrenceEditor'></div>
</td>
</tr>
<tr>
<td class="e-textlabel">@DisplayName.Patient</td>
<td colspan="4">
<input id="PatientId" class="e-field" type="text" name="PatientId" />
</td>
</tr>
<tr>
<td class="e-textlabel">@DisplayName.Description</td>
<td colspan="4">
<textarea rows="5" id="Description" class="e-field e-input" name="Description"></textarea>
</td>
</tr>
</tbody>
</table>
</script>
In the onpopup we add extra's
function onPopupOpen(args) {
schedulesVue._data.errormessage = '';
if (args.type === 'Editor') {
let scheduleObj = document.getElementById('schedule').ej2_instances[0];
let specParam = scheduleObj.dataModule.query.params.find(x => x.key == "TeammemberId");
if (!specParam) {
scheduleObj.dataModule.query.addParams("TeammemberId", schedulesVue._data.selectedCareprovider.Id);
} else {
specParam.value = schedulesVue._data.selectedCareprovider.Id;
}
scheduleObj.refreshEvents();
args.element.querySelector('#teammembername').innerHTML = schedulesVue._data.selectedCareprovider.FullName;
let locationElement = args.element.querySelector('#LocationId');
if (!locationElement.classList.contains('e-dropdownlist')) {
let dropDownListObject = new ej.dropdowns.DropDownList({
// placeholder: @Json.Serialize(DisplayName.Location),
fields: {
value: 'Id',
text: 'Name'
},
value: args.data.LocationId,
dataSource: schedulesVue._data.locations
});
dropDownListObject.appendTo(locationElement);
}
let startElement = args.element.querySelector('#StartTime');
if (!startElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(startElement.value) || new Date(), firstDayOfWeek: 1 }, startElement);
}
let endElement = args.element.querySelector('#EndTime');
if (!endElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(endElement.value) || new Date(), firstDayOfWeek: 1 }, endElement);
}
let appointmentTypeElement = args.element.querySelector('#AppointmentTypeId');
if (!appointmentTypeElement.classList.contains('e-dropdownlist')) {
let dropDownListObject = new ej.dropdowns.DropDownList({
// placeholder: @Json.Serialize(DisplayName.Location),
fields: {
value: 'Id',
text: 'Description'
},
value: args.data.AppointmentTypeId,
dataSource: schedulesVue._data.appointmentTypes
});
dropDownListObject.appendTo(appointmentTypeElement);
}
let recurElement = args.element.querySelector('#RecurrenceEditor');
if (!recurElement.classList.contains('e-recurrenceeditor')) {
let recurrObject = new ej.schedule.RecurrenceEditor({});
recurrObject.appendTo(recurElement);
recurrObject.setRecurrenceRule(args.data.RecurrenceRule);
scheduleObj.eventWindow.recurrenceEditor = recurrObject;
}
} else if (args.type === 'QuickInfo') {
if (args.data.Location) {
args.element.querySelector('div .e-location-details').innerText = args.data.Location.Name;
}
let resource = args.element.querySelector('div .e-resource');
if (resource) {
let parent = resource.parentElement;
parent.removeChild(resource);
}
}
}
Creating an event without recurrence : ok
Updating an event wihout recurrence : ok
Delete an event without recurrence : ok
Creating an event with recurrence : ok
Updating an event with recurrence, choosing Entire series : ok
Deleting an event with recurrence, choosing Entire series : ok
Updating event with recurrence, choosing This event: ERROR
constants.js:93 Uncaught TypeError: Cannot read property 'StartTime' of undefined
at a (VM14024 ej2.min.js:10)
at e.<anonymous> (VM14024 ej2.min.js:10)
at e.notify (VM14024 ej2.min.js:10)
at t.e.trigger (VM14024 ej2.min.js:10)
at e.processOccurrences (VM14024 ej2.min.js:10)
at e.saveEvent (VM14024 ej2.min.js:10)
at t.saveEvent (VM14024 ej2.min.js:10)
at e.processCrudActions (VM14024 ej2.min.js:10)
at e.<anonymous> (VM14024 ej2.min.js:10)
at e.notify (VM14024 ej2.min.js:10)
Any suggestions ?