oneventRendered(args:EventRenderedArgs):void{
let categoryColor: string = args.data.CategoryColor as string;
args.element.style.backgroundColor = categoryColor
args.element.style.borderColor = categoryColor
}
onPopupOpen(args: PopupOpenEventArgs): void {
if (args.type === 'Editor') {
if (!args.element.querySelector('.custom-field-row')) {
let row: HTMLElement = createElement('div', { className: 'custom-field-row' });
let formElement: HTMLElement = <HTMLElement>args.element.querySelector('.e-schedule-form');
formElement.firstChild.insertBefore(row, args.element.querySelector('.e-title-location-row'));
let container: HTMLElement = createElement('div', { className: 'custom-field-container' });
let inputEle: HTMLInputElement = createElement('input', {
className: 'e-field', attrs: { name: 'CategoryColor' }
}) as HTMLInputElement;
container.appendChild(inputEle);
row.appendChild(container);
let drowDownList: DropDownList = new DropDownList({
dataSource: [
{ text: 'Azul', value: '#2271B3' },
{ text: 'Azul Claro', value: '#ADD8E6' },
{ text: 'Rojo', value: '#FF6961' },
{ text: 'Gris', value: '#696969' },
{ text: 'Cafe', value: '#804000' },
{ text: 'Rosa', value:'#DB7093'},
{ text: 'Amarillo', value:'#FFD700'},
],
fields: { text: 'text', value: 'value' },
value: (args.data as { [key: string]: Object }).CategoryColor as string,
floatLabelType: 'Always', placeholder: 'Selecciona un color...'
});
drowDownList.appendTo(inputEle);
inputEle.setAttribute('name', 'CategoryColor');
}
}
}