question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tooltipster doens't work in table cells

See original GitHub issue

Hi I’be been trying to add tooltip inside of td but it seems doesn’t work. I have table with angular like this:

<script>
		    $(document).ready(function() {
		    	$('.tooltipAviso').tooltipster({
		    		contentCloning: true,
		    		contentAsHTML : true,
		    		side : "left"
		    	});
	        });
<tr ng-repeat="aviso in paginacao.registros">
							<td>{{aviso.numeroAvisoPagamento}}</td>
							<td>{{aviso.qtdeNotasCobrancaLancamento}}</td>
							<td>{{aviso.qtdeNotasAviso}}</td>
							<td>{{aviso.dataAvisoPagamento | date:'dd/MM/yyyy'}}</td>
							<td>{{aviso.dataConciliacaoAviso | date:'dd/MM/yyyy HH:mm:ss'}}</td>
							<td><span class="label label-{{aviso.statusAvisoPagamento}}">{{aviso.statusAvisoPagamento | format : 'statusConciliacaoAuto'}}</span></td>
							<td>{{aviso.tipoLoteAvisoPagamento}}</td>
							<td>{{aviso.resumoAvisoPagamento.valorTotalBruto | currency:"R$ ":0}}</td>
							<td class="text-right">
									<!-- <span ng-show="{{permiteApagarAviso.indexOf(aviso.statusAvisoPagamento) > -1}}" class="tooltipAviso fa fa-thumbs-down fa-3" 
									    style="cursor:pointer" ng-click="removerAviso(aviso)" data-tooltip-content="#tooltip_content">
									</span> -->
									<div class="tooltipAviso" data-tooltip-content="#tooltip_content">Cell content</div>
								<!-- <i ng-show="{{permiteTotalizador.indexOf(aviso.statusAvisoPagamento) > -1}}" style="cursor:pointer" 
								   class="fa fa-bar-chart fa-3" aria-hidden="false" ui-sref="adm_aviso_pagamento_totalizador({numAviso:aviso.numeroAvisoPagamento})">
								</i> -->
								<i class="fa fa-bars fa-3" style="cursor: pointer;" ui-sref="adm_aviso_pagamento_log({id:aviso.id,aviso:aviso})"></i>
							</td>
						</tr>

The tooltip doesn’t work, but if I setup in another element outside of table , it works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
ramilani12commented, Mar 7, 2017

Hi louisameline

Thanks for your help. As you said I fixed with delegation. My solution is:

<script>
		     $(document).ready(function() {
		    	 var tooltipInstance;
		    	 $("body").on('mouseover', 'span:not(.tooltipstered)', function(){
		    	     tooltipInstance = $(this).tooltipster({
		    	    	 contentCloning: true,
				    	 contentAsHTML : true,
				    	 side : "top"
		    	     });
		    	     tooltipInstance.tooltipster('open');
		    	 });
		    }); 
	    </script>

Table

<tbody>
						<tr ng-repeat="aviso in paginacao.registros">
							<td>{{aviso.numeroAvisoPagamento}}</td>
							<td>{{aviso.qtdeNotasCobrancaLancamento}}</td>
							<td>{{aviso.qtdeNotasAviso}}</td>
							<td>{{aviso.dataAvisoPagamento | date:'dd/MM/yyyy'}}</td>
							<td>{{aviso.dataConciliacaoAviso | date:'dd/MM/yyyy HH:mm:ss'}}</td>
							<td><span class="label label-{{aviso.statusAvisoPagamento}}">{{aviso.statusAvisoPagamento | format : 'statusConciliacaoAuto'}}</span></td>
							<td>{{aviso.tipoLoteAvisoPagamento}}</td>
							<td>{{aviso.resumoAvisoPagamento.valorTotalBruto | currency:"R$ ":0}}</td>
							<td class="text-right">
								<span ng-show="{{permiteApagarAviso.indexOf(aviso.statusAvisoPagamento) > -1}}" class="tooltipAviso fa fa-thumbs-down fa-3" 
								    style="cursor:pointer" ng-click="removerAviso(aviso)" 
								    data-tooltip-content="#tooltip-content">
								</span>
								<!-- <i ng-show="{{permiteTotalizador.indexOf(aviso.statusAvisoPagamento) > -1}}" style="cursor:pointer" 
								   class="fa fa-bar-chart fa-3" aria-hidden="false" ui-sref="adm_aviso_pagamento_totalizador({numAviso:aviso.numeroAvisoPagamento})">
								</i> -->
								<span  data-tooltip-content="#tooltip-content1" class="tooltipAviso fa fa-bars fa-3" 
								       style="cursor: pointer;" ui-sref="adm_aviso_pagamento_log({id:aviso.id,aviso:aviso})">
								</span>
							</td>
						</tr>
					</tbody>

The content of tooltip:

<div class="tooltip_templates">
  				<span id="tooltip-content">
      				<strong>This is the content of my tooltip!</strong>
  				</span>
  				<span id="tooltip-content1">
      				<strong>This is the content of my tooltip1!</strong>
  				</span>
  			</div>
0reactions
louisamelinecommented, Mar 7, 2017

Ok. You should not call your variable tooltipInstance though because it’s not a Tooltipster instance, it’s just the jQuery-wrapped HTML element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tooltip doesn't work in a table cell - Stack Overflow
I am using tooltipster tooltip plugin (http://iamceege.github.io/tooltipster/) on my website. However my question is more related to JS instead ...
Read more >
Tooltipster doens't work in table cells · Issue #666 - GitHub
Hi I'be been trying to add tooltip inside of td but it seems doesn't work. I have table with angular like this:
Read more >
Customizing tooltips in Power BI Desktop - Microsoft Learn
Create custom tooltips for visuals using drag-and-drop. ... You can customize tooltips in Power BI Desktop and in the Power BI service.
Read more >
Bootstrap Tooltip doesn't not work in childrow - DataTables
tooltip();. is selecting all matching elements when that code runs. But the child row is not in the document when that code runs,...
Read more >
How to add tooltip to HTML table cell without using JavaScript
Approach 1: Create a HTML table. Add title attribute (title = “someTitle”) to the table cell to add tooltip.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found