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 reasonElement = args.element.querySelector('#Description');
var rteValue = args.target.classList.contains("e-work-cells") ? args.data.Description : args.data.Description;
if (!reasonElement.classList.contains('e-richtexteditor')) {
var richtextEditorObject = new ej.richtexteditor.RichTextEditor({
value: rteValue
});
richtextEditorObject.appendTo(reasonElement);
reasonElement.setAttribute('name', 'Description');
}
}
}
|