Skip to content
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

Tooltip on Buttons in Columns #741

Closed
jgatringer opened this issue Sep 8, 2016 · 3 comments
Closed

Tooltip on Buttons in Columns #741

jgatringer opened this issue Sep 8, 2016 · 3 comments
Labels

Comments

@jgatringer
Copy link

Hello, one more request from me:

I would like to have Bootstrap Tooltips on Buttons in an -> addColumn (who explain the icons).

Same Code then last time :-)

`
return Datatables::of($listquery)
->addColumn('action', 'teams.action')
->make(true);

i load here a extra page with the condition, and the buttons

`

@can('team.admin') <a href="/myteams/teammemberlist/{!! $teamid !!}" class="btn btn-xs btn-primary"> <i class="fa fa-pencil-square"></i> </a> @endcan

The Bootstrap Code looks like this:

<a href="/myteams/teammemberlist/{!! $teamid !!}" class="btn btn-xs btn-primary" data-toggle="tooltip" title="edit the row!"> <i class="fa fa-pencil-square"></i> </a>

Normalous i do the javascript code at the bottom of the template
<script> $(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); }); </script>

System details

How can i get this working in datatables?

System details

i use homestead on windows for development

OS: Windows 10
PHP: 7.0
Laravel Version: 5.2
DB: mysql on (actual) homestad machine

@yajra
Copy link
Owner

yajra commented Sep 9, 2016

@jgatringer you need to add the tooltip js on drawCallback or draw.dt event of DataTables.

$('table').on('draw.dt', function() {
    $('[data-toggle="tooltip"]').tooltip();
})

@yajra yajra added the question label Sep 9, 2016
@jgatringer
Copy link
Author

Yes. Thanks a lot! Looks great now.

@aaqibmehran
Copy link

aaqibmehran commented Feb 20, 2018

How to escape row title attribute for tooltip ? Or How to add tooltip to row ? or make our own using div ?

@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants