Based on a sample (https://ej2.syncfusion.com/aspnetcore/Schedule/BlockEvents#/material) I created a scheduler, I created my own editor for new events, but I ran into one problem.
After loading the page and double-clicking in the scheduler cell, the editor will be displayed. But when I close it and double-click on the cell again, it will no longer appear and the console will display an error:
Uncaught TypeError: Cannot set property 'innerHTML' of null
at e.onCellDetailsUpdate (constants.js: 93)
at e.openEditor (constants.js: 93)
at e.(constants.js: 93)
at e.notify (constants.js: 93)
at t.e.trigger (constants.js: 93)
at e.cellDblClick (constants.js: 93)
|
<ejs-schedule id="schedule" width="100%" height="550px" locale="cs" selectedDate="new DateTime(2018, 2, 15)">
</ejs-schedule>
<script>
// We can change the default text contents of the Schedule with the help of the load method of the L10n class
var L10n = ej.base.L10n;
L10n.load({
"cs": {
"schedule": {
"newEvent": "Test",
},
}
});
</script> |
|
function onPopupOpen(args) {
if (args.type === "Editor") {
var dialogObj = document.getElementById("schedule_dialog_wrapper").ej2_instances[0];
dialogObj.header = '<div style="color:#ffffff"></div>';
}
} |
|
<script>
function onPopupOpen(args) {
if (args.type === "Editor") {
var dialogObj = document.getElementById("schedule_dialog_wrapper").ej2_instances[0];
var carName = args.data.CarName;
dialogObj.headerEle.querySelector(".e-title-text").innerText = "New car reservation - " + (carName ? carName : "Unknown");
}
}
</script> |
|
function onPopupClose(args) {
if (args.type === "Editor") {
var scheduleObj = document.querySelector(".e-schedule").ej2_instances[0];
// Refresh Schedule events
scheduleObj.refreshEvents();
}
} |