function onPopupOpen(args) {
if (args.type === 'Editor') {
var statusElement = args.element.querySelector('#EventType');
if (!statusElement.classList.contains('e-dropdownlist')) {
var dropDownListObject = new ej.dropdowns.DropDownList({
placeholder: 'Choose status', value: statusElement.value,
dataSource: ['New', 'Requested', 'Confirmed']
});
dropDownListObject.appendTo(statusElement);
statusElement.setAttribute('name', 'EventType');
}
var startElement = args.element.querySelector('#StartTime');
if (!startElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(startElement.value) || new Date() }, startElement);
}
var endElement = args.element.querySelector('#EndTime');
if (!endElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(endElement.value) || new Date() }, endElement);
}
{
var dialogObj = (args.element).ej2_instances[0];
if (args.target !== undefined) {
if (document.querySelector('.custom') === null) {
aa = document.querySelector('.e-footer-content');
var but = document.createElement('button');
but.className = "custom";
but.innerText = "custom";
aa.appendChild(but);
}
document.querySelector('.e-event-delete').innerText = "Remove"
document.querySelector('.e-event-save').innerText = 'Ok';
dialogObj.dataBind();
document.querySelector('.custom').addEventListener("click", function () { alert('editor window'); });
}
}
}
} |