-
-
Notifications
You must be signed in to change notification settings - Fork 876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom tooltip template? #249
Comments
Currently, you have to customise the complete event template for that. |
I'm already using a custom event template. But it seems like i can only edit the text inside the tooltip, but not include html and angular code. Any instructions or pointers to lead me in the right direction? I was tring to use the ngbTooltip instead, which used to work with the angular 1 version of the calendar, but I can't seem to access the event data. |
If you're already using ng-bootstrap + custom templates then I'd recommend using the |
Code below results in following error: "TypeError: Cannot read property 'Type' of undefined". Pointing to the event variable inside the tooltop. The cellTemplate works perfect.
|
I've never tried it, but are you able to nest the tooltip |
I've just released 0.18.0 which allows an extra |
Any example on how to implement the new template? I keep getting the following message: Can't bind to 'tooltipTemplate' since it isn't a known property of 'div' Edit: on version 0.18.2 |
See example/default: 82faaf4#diff-f8d443cdb3ec4f4d1eb91fde0e041837R23 |
I really can't get it to work. Keep getting these errors inmy month-cell template:
|
You're missing off the selector for the tooltip directive: https://github.com/mattlewis92/angular-calendar/blob/master/src/components/month/calendarMonthCell.component.ts#L20 |
That fixed the errors, but still not seeiing any tooltip. I have the following inside my 'component html':
And these are my templates:
|
I can't see anything wrong with that, can you make a plunker that reproduces it please? BTW if you're not using directives / custom components in your tooltip it already accepts html, it might be easier for you to use the provider to control the tooltip template. See this demo of how to do it (but change the 3 overridden methods to return the content you want instead of an empty string): https://mattlewis92.github.io/angular-calendar/#/disable-tooltips |
As ordered :) : http://embed.plnkr.co/N7OlBurlmTCQ4Scok9kS/ |
That's really helpful thanks! It looks like I forgot to make the |
Updated but still no luck. And i'm guessing you copied the wrong plunker link :). |
Ah I don't think I hit save! I'm away on holiday for the next week so will be able to help you more then, but iirc I only had to change 2 lines to get your plunked to work so maybe you can figure it out by then 🙃 |
Save on the plunker, or save on the changes you made for 0.18.3? Cause it seems the only thing changed in 0.18.3 is the changelog file :). I'll see if i can find some magic to get it working :). |
Ok, got it working. So i moved [tooltipTemplate]="cellTooltipTemplate" from the mwl-calendar-month-view, into my customCellTemplate, and i had to add a value to the mwlCalendarTooltip directive. When empty/blank/null the tooltip won't show.
|
Ah of course, I deliberately disable the tooltip if you pass an empty value. I guess it's an edge case that can just be solved via better documentation. Glad you got it sorted 🙂 |
Can you please explain how to show tooltip for the eventTemplate? It should work the same way, shouldn't it? |
Hai @mythjuha @mattlewis92 I am trying to replicate the below code but I got some issue with that Can anyone provide me a reference for adding a customized tooltip In a calendar. <ng-template #cellTemplate {{ day.date | calendarDate:'monthViewDayNumber':locale }} <div class="cal-events" *ngIf="day.events.length > 0"> <div class="cal-courseevent" *ngFor="let event of day.events" mwlCalendarTooltip="true" [tooltipEvent]="event" [tooltipTemplate]="cellTooltipTemplate" [ngClass]="event.Type" (mwlClick)="onEventClick($event, event)"> <div class="event-warning-exam" *ngIf="event.Type == 'Examen' || event.Type == 'Herexamen'"> <div [ngClass]="{'event-warning-margin': event.Type == 'Examen' || event.Type == 'Herexamen'}"> {{event.From | amDateFormat: 'HH:mm'}}: {{event.title}} |
Did you find a solution for this ? |
Bug description / Feature request:
Feature request
Versions
Angular: 4.2.3
Calendar library: 0.17.3
Is there a way to customise the tooltip template?
The text was updated successfully, but these errors were encountered: