I'm trying to display content on multiple lines in the tooltip of calendar entry for UI Calendar and it is not working.
Here is the code
$scope.onEventRender = function(event, element, view) {
if(event.hover_data) {
$timeout(function(){
var hdata = event.hover_data.join('<br />');
element.attr({'tooltip': hdata, 'tooltip-append-to-body': true});
$compile(element)($scope);
});
}
}
Here is how it looks
Please let me know what I'm doing wrong.
Whenever a mouse gets hovers on that specific attribute, it will show text or other information known as a tooltip. It can be displayed at right, left, top or bottom at any position of the text. This is as follows: 1. Top Position In this position, a tooltip will be displayed at the top of the element. 2. Right Position
One can set a position to that tool tipped text by using CSS, which helps us to define some style and position to our tooltip. Using a tooltip to our WebPages is helps us do more interaction with the user because it gives short information of included elements. HTML uses a method that defines tooltip by using the link with a title attribute.
The title is considered as a global attribute, so it allows the user to easily add it to the element, which is as simple as adding a class or id to the element. With the help of that, one can add simply anything means paragraph, div block, which is containing whole column and many more things. Basically, a tooltip is shown top of the element.
As shown in the above syntax, the text displayed in the title attribute is considered as tool tipped text. So users can click this link to see more information about it. The title is considered as a global attribute, so it allows the user to easily add it to the element, which is as simple as adding a class or id to the element.
There is no tooltip functionality in ui-calendar. You are probably using bootstrap-ui-tooltip. Besides tooltip
it also has a property tooltip-html-unsafe
(since v0.3.0, released on 1 May 2013), it was renamed lately.
You can read about it in some old documenatation
I made a plunker with html content tooltips
Stuff that worked for me. Might be useful for someone else
var tooltipText = ['Tooltip', 'text', 'to', 'be', 'split'];
$(element).tooltip({html: true, title: tooltipText.join('</br>')});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With