jQWidgets Forums
Forum Replies Created
-
Author
-
What about for week and day views?
December 19, 2017 at 9:36 pm in reply to: Custom appointment tooltip Custom appointment tooltip #97974I’m also trying to implement a customized tool-tip when hovering over an appointment.
Angular code:
renderAppointment: any = function(data) { if (data && data.appointment) { const originalAppointment = this.appointments.find( appointment => appointment.id === data.appointment.id ); let title = ''; if (originalAppointment.originalData.IsPrivate) { data.html = '<b>Private</b>'; data.background = '#dbdbdb'; data.borderColor = '#dbdbdb'; title = 'Private'; } else { data.html = <code><b>${originalAppointment.subject}</b><br></code>; data.html += originalAppointment.description ? <code>${originalAppointment.description}<br></code> : ''; if (originalAppointment.originalData.IsRecurring) { const endingRecurrence = originalAppointment.originalData.isLastRecurrrence; if (endingRecurrence) { data.html += '<br><span style="color: red;">Warning: This recurring appointment series is ending soon</span>' + '<br><img src="assets/images/Refreshiconred.png">'; } else { data.html += '<img src="assets/images/Recurrence.png">'; } } data.html += originalAppointment.originalData.NoteStatus ? <code><span>${originalAppointment.originalData.NoteStatus}</span></code> : ''; title += originalAppointment.originalData.PatientName ? originalAppointment.originalData.PatientName + '-\n' : originalAppointment.subject + '-\n'; title += originalAppointment.originalData.NoteStatus + '\n'; const format = 'h:mm tt'; title += originalAppointment.from.toString(format) + '-'; title += originalAppointment.to.toString(format) + '\n'; title += originalAppointment.originalData.PatientPhone && originalAppointment.originalData.PatientPhone !== '0' ? 'Home: ' + originalAppointment.originalData.PatientPhone + '\n' : '' ; title += originalAppointment.originalData.PatientMobile && originalAppointment.originalData.PatientMobile !== '0' ? 'Cell: ' + originalAppointment.originalData.PatientMobile + '\n' : '\n' ; title += originalAppointment.description; } data.html = <code><div title="${title}"></code> + data.html + '</div>'; } data.textColor = '#black'; return data; };
I’m getting a console error when I hover over an appointmentthat says:
Cannot read property ‘indexOf’ of null at b.(anonymous function).getJQXAppointmentByElementI believe the problem arises in this line:
data.html =
<div title=”${title}”>+ data.html + '</div>';
Why is there a problem wrapping the rendered appointment’s html in a parent divTo rephrase my question: When an appointment has been changed, is it possible to tell if the change was a resize or a drag & drop? I’m implementing the onAppointmentChange event handler and actually have come up with a workable solution that calculates the duration of the target appointment and compares that to the original appointment (if both durations are the same, then it was not a resize). I can now distinguish between whether an appointment has been resized or dropped, but it would be nice if there was a way to distinguish this without calculations
-
AuthorPosts