Hello,
I need to show delete alert confirmation when selecting 'delete appointment' from the context menu.
Today, when I select the delete option, the appointment is deleted without any confirmation.
This is the context menu code:
function onMenuItemSelect(args) {
var scheduleObj = document.querySelector(".e-schedule").ej2_instances[0];
var selectedMenuItem = args.item.id;
var eventObj;
if (selectedTarget.classList.contains('e-appointment')) {
eventObj = scheduleObj.getEventDetails(selectedTarget);
}
switch (selectedMenuItem) {
case 'Today':
scheduleObj.selectedDate = new Date();
break;
case 'Add':
var selectedCells = scheduleObj.getSelectedElements();
var activeCellsData = scheduleObj.getCellDetails(selectedCells.length > 0 ? selectedCells : selectedTarget);
if (selectedMenuItem === 'Add') {
scheduleObj.openEditor(activeCellsData, 'Add');
} else {
scheduleObj.openEditor(activeCellsData, 'Add', null, 1);
}
break;
case 'Save':
scheduleObj.openEditor(eventObj, selectedMenuItem);
break;
case 'Delete':
scheduleObj.deleteEvent(eventObj);
break;
}
}
When I select the delete option within edit dialog it shows the confirmation:
How can I do that?