Steps to reproduce:
- Open this demo: https://js.devexpress.com/Demos/WidgetsGallery/Demo/Scheduler/Editing/jQuery/Light/
- Handle the onAppointmentFormOpening event and in the event handler add this code:
JavaScriptfunction onAppointmentFormOpening(data) {
const form = data.form;
form.itemOption("mainGroup.endDate", "visible", false);
}
- Open the appointment form twice.
Expected behavior:
No errors in console.
Current behavior:
The "Cannot read property 'option' of undefined" error occurs
Additional information:
Sample project:
https://codepen.io/LexDevExpress/pen/yLJeLdw
Workaround - Hide a label and an editor instead of hiding the entire form item:
JavaScriptfunction onAppointmentFormOpening(data) {
const form = data.form;
form.itemOption("mainGroup.endDate", "label", { visible: false });
form.getEditor("endDate").option("visible", false);
}