hmahdavi
hmahdavi

Reputation: 2354

How to run popover for elements inside dataTables?

I try to run bootstrap popover for some elements inside table that I run datatable on it.I use this code but dont worked.

JS:

$('#dynamic-table1').dataTable({
    "aaSorting": [
        [3, "desc"]
    ],
    "fnDrawCallback": function (oSettings) {
        $('[data-toggle="popover"]').popover();
    }
});

html:

<a data-toggle="popover" title="توضیحات کاربر ارشد" data-content="Description" data-trigger="focus">

How solve this?

Upvotes: 5

Views: 5625

Answers (2)

Alp Altunel
Alp Altunel

Reputation: 3443

you can use same but different syntax in bootstrap 5.

<button type="button" class="btn btn-lg btn-danger" 
    data-bs-toggle="popover" data-bs-trigger="hover focus"
    data-bs-content="And here's some amazing content. It's very engaging. Right?">
    Click to toggle popover
 </button>

Upvotes: 0

davidkonrad
davidkonrad

Reputation: 85518

Define not working? My guess is you are confusing focus with hover :

<a data-toggle="popover" title="توضیحات کاربر ارشد" data-content="Description" 
   data-trigger="hover">
popover
</a>

and then your code works -> http://jsfiddle.net/ehnnm5kk/

Upvotes: 3

Related Questions