Tooltips or other jQuery Tools don't work with datatable with fnReloadAjax

Tooltips or other jQuery Tools don't work with datatable with fnReloadAjax

Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
edited June 2013 in General
Hi,

I have searched everywhere on this forum, or on Google, many solutions but zero worked for me...
I red that this is a problem with the DOM destroying from Datatable. What could be the solution ?
I want to use tooltips from Bootstrap in some cells; Table is auto-reloaded every 15sec using fnReloadAjex method.

If you can help me

Replies

  • Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
    Up
  • allanallan Posts: 63,133Questions: 1Answers: 10,399 Site admin
    Did you reinitialise the tooltips etc after the new content has been loaded?

    Allan
  • Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
    edited June 2013
    Hi Allan,
    Thank you for trying to help me :) .

    My page look like this :

    "sAjaxSource": 'directory/tabledata'

    [...]

    setInterval( function () {
    oTable.fnReloadAjax();
    }, 15000 );
    } );

    [...]

    // call jQuery, datatables.js, tooltip.js etc...


    $('.ltooltip').tooltip()


    ----
    So i don't think that i "reinitialise" the tooltips, but i'm not sure how to do it, i don't understand very well what you mean.
  • allanallan Posts: 63,133Questions: 1Answers: 10,399 Site admin
    You need to call `$('.ltooltip').tooltip() ` when the data has been reloaded. fnReloadAjax has a callback option, use that to execute a function with that code in it.

    Allan
  • Alex67000Alex67000 Posts: 39Questions: 6Answers: 0
    edited June 2013
    Ahah, that was so easy, i just had to use this magical "fnDrawCallback" :)
    Thank you so much Allan! I want to say that datatable is one of the best website plugin ever!

    I have a little question:
    is it possible to stop the reloading, when user is reading the tooltip, (cursor on the tooltip link) ?
This discussion has been closed.