onPopupOpen(args: PopupOpenEventArgs): void {
if (args.type === 'EventContainer') {
let instance: Internationalization = new Internationalization();
let date: string = instance.formatDate((<any>args.data).date, { skeleton: 'MMMEd' });
((args.element.querySelector('.e-header-date')) as HTMLElement).innerText = date;
((args.element.querySelector('.e-header-day')) as HTMLElement).innerText = 'Event count: ' + (<any>args.data).event.length;
// Creating custom element
if (!args.element.querySelector('.custom')) {
var div = document.createElement("div");
div.classList.add('custom');
div.innerHTML = "<img src='https://ej2.syncfusion.com/demos/src/schedule/images/birthday.svg'>";
args.element.querySelector('.e-more-event-popup').insertBefore(div, args.element.querySelector('.e-more-event-content'));
}
}
} |
onPopupOpen(args: PopupOpenEventArgs): void {
if (args.type === 'EventContainer') {
(args.element.querySelector('.e-more-event-content') as any).style.display = 'none';
const data = args.data.event;
if (!args.element.querySelector('.custom-popup')) {
const div = document.createElement('div');
div.classList.add('custom-popup');
data.forEach(e => {
div.innerHTML = div.innerHTML +
'<div class="user-item" style="padding-left: 15px;">' +
' <div class="header" style="display: flex">' +
' <span class="e-icons e-resource"></span>' +
' <span class="user" style="padding-left: 10px;">' + e.User + '</span>' +
' </div>' +
' <div class="tasks-list">' +
' <div class="item" style="display: flex;align-items: center">' +
' <span class="e-icons e-tick"></span>' +
' <span class="name" style="padding-left: 10px;">' + e.Subject + '</span>' +
' <span style="padding-left: 10px;">(Ouvrage 1)</span>' +
' </div>' +
' </div>' +
'</div>';
});
args.element.querySelector('.e-more-event-popup').appendChild(div);
}
(args.element.querySelector('.e-more-event-close') as any).onclick = this.clear;
}
} |
public onDataBound(): void {
let moreEle: any = document.querySelectorAll('.e-more-indicator');
if (moreEle.length > 0) {
for (let i = 0; i < moreEle.length; i++) {
let text = moreEle[i].innerText;
text = parseInt(text);
if (text == 1) {
moreEle[i].style.backgroundColor = '#4cf1e8';
} else if (text >= 2 && text <= 5) {
moreEle[i].style.backgroundColor = '#b6edb6';
} else {
moreEle[i].style.backgroundColor = '#ebb5e5';
}
}
}
} |
public onDataBound(): void {
let moreEle: any = document.querySelectorAll('.e-more-indicator');
if (moreEle.length > 0) {
for (let i = 0; i < moreEle.length; i++) {
let index = moreEle[i].getAttribute('data-group-index');
let color = this.scheduleObj.getResourcesByIndex(index).resourceData
.color;
moreEle[i].style.backgroundColor = color;
}
}
} |