Bootstrap tooltip not rendered properly after paginating

Bootstrap tooltip not rendered properly after paginating

crush123crush123 Posts: 417Questions: 126Answers: 18
edited September 2015 in DataTables 1.10

I have a bootstrap tooltip which is displayed on hover, if a notes field has data

the tooltip is activated on initComplete(), and works on page load

however, when I change to page 2, for example, the tooltip no longer renders properly

initComplete: function ( settings, json ) {
        //activate the bootstrap toggle js
        $('[data-toggle="tooltip"]').tooltip({
            trigger: 'hover',
            html: true
            });

        }

http://schoolshop.forthwebsolutions.com/plugins/shop/stocklist_cart_ajax.php

pressing F5 and refreshing the page gets it back

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Answer ✓

    See second top FAQ :-)

    In this case if you can't make the tooltip plug-in use a delegated event you would probably be best using the createdRow callback to add the plug-in to the rows as they are created.

    Allan

  • crush123crush123 Posts: 417Questions: 126Answers: 18

    Thanks Allan.

    Well. I'm not sure I fully understand it.
    I tried the createdRow callback, but it didn't seem to do anything for me, then I stumbled upon using .on with mouseover and it seems to work.

        $('#example tbody').on('mouseover', 'tr', function () {
            $('[data-toggle="tooltip"]').tooltip({
                trigger: 'hover',
                html: true
            });
        });
    
  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Delegated events such as this are absolutely the way forward :-)

    Allan

This discussion has been closed.