Hi there,
I want to add another DialogComponent as nested dialog in schedule's default editor when adding / editing event.
I am happy with most of the built-in editor, I found it's possible to overwrite the default editor by appending DialogComponent after ScheduleComponent, then nest another one next to it, see the code below:
function onPopupOpen(args) {
if (args.type === "Editor") {
args.cancel = true;
if (args.target.classList.contains("e-appointment")) {
// this.temp = false;
eventDialog.header = "Edit Event";
eventDialog.show();
let btnOpenEle = document.querySelector("#btnOpen");
btnOpenEle.onclick = function () {
nestedDialog.show();
};
} else {
// this.temp = true;
eventDialog.header = "New Event";
eventDialog.show();
}
}
}
<ScheduleComponent
ref={(t) => (scheduleObj = t)}
popupOpen={onPopupOpen}
popupClose={onPopupClose}
......
ScheduleComponent>
<DialogComponent
id="eventDialog"
showCloseIcon={true}
visible={false}
width="500px"
ref={(dlg) => (eventDialog = dlg)}
// animationSettings={effect}
closeOnEscape={false}
target="#targetElement"
content={editorContent}
buttons={buttons}
>DialogComponent>
<DialogComponent
id="innerDialog"
showCloseIcon={true}
visible={false}
width="500px"
height="500px"
ref={(dlg) => (nestedDialog = dlg)}
// animationSettings={effect}
closeOnEscape={false}
target="#eventDialog"
>DialogComponent>
- Is there any other better way to do it?
- In this way, it will be a lot of efforts to overwrite the whole default editor, do you have any samples with fully customised editor that has the same functionalities (not only rendering but also CRUD) as the default editor?
Cheers,
Jay