Hello,
In the scheduler's editor window we've added a custom button, like so:
let buttons = dialogObj.buttons;
buttons.unshift({
buttonModel:{
content:"Convert",
isPrimary:false,
cssClass:"e-custom-btn1"
},
click: convertToVisit.bind(args)
});
dialogObj.setProperties({
buttons: buttons
});
In convertToVisit method we would like to save the event prior to executing our custom logic. We have tried to simulate saving by invoking the click method of the Save button:
function convertToVisit(args){
if((/Mobi|Android/i.test(navigator.userAgent))){
document.querySelector('.e-dlg-header-content .e-dlg-header .e-title-header .e-save-icon').click();
}
else{
document.querySelector('.e-schedule-dialog .e-event-save').click();
}
...
}
But the above code is clumsy. Getting reference of the Save button depends on the browser and device's style and it is not a safe assumption.
Is there any better / more standard way to call the default save method of the edit window?