tooltips after fnReloadAjax

tooltips after fnReloadAjax

loadbrainloadbrain Posts: 18Questions: 0Answers: 0
edited July 2009 in General
I am using the fnReloadAjax function from http://datatables.net/plug-ins#api_fnReloadAjax, everything works fine so far but:
On my first load of the table, I use tooltips with fnInitComplete to show some additional data. After fnReloadAjax these tooltips do not work anymore, how can I get them running?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi loadbrain,

    You just need to add the event handlers to the table rows again after the fnReloadAjax call as re-initialised the table. You might need to add a callback function to the plug-in or just customise it to your needed.

    This demo might be of some use: http://datatables.net/examples/example_events_post_init.html
    As might Visual Event - which shows what elements have events attached: http://www.sprymedia.co.uk/article/Visual+Event

    Regards,
    Allan
  • loadbrainloadbrain Posts: 18Questions: 0Answers: 0
    Ok, I figured it out.
    Now I only need to get this tooltips also displaying after going to the next results via the pagination....
  • loadbrainloadbrain Posts: 18Questions: 0Answers: 0
    Ok, I now I figured even this out... keep working... ;-)
  • matrixnmatrixn Posts: 2Questions: 0Answers: 0
    can you share with me the solution for working tooltips when you advance to the next pages?
  • matrixnmatrixn Posts: 2Questions: 0Answers: 0
    The solution is in fnDrawCallback which is called on every table draw (init, next page... and filter).

    Just ad this at your table options:

    "fnDrawCallback": function() { tooltips(); },

    where tooltips is a tooltip function like:
    var tooltips = function() {
    $('a.tips').cluetip({
    arrows: true,
    dropShadow: true,
    cursor: 'pointer',
    cluetipClass: 'jtip'
    });
    };
This discussion has been closed.