Callback when complete?

Callback when complete?

JasonColeyNZJasonColeyNZ Posts: 11Questions: 4Answers: 0

Hi there,

I am using the fnInitComplete callback and trying to do things with the overlay table that is created with FixedColumns. However on InitComplete the overlay doesn't exist in the DOM yet. So question is, how can I find out when I can work on the overlay table?

Jason

This question has an accepted answers - jump to answer

Answers

  • JasonColeyNZJasonColeyNZ Posts: 11Questions: 4Answers: 0

    Is what I am trying to do is to allow bootstrap tooltips in one of the fixed columns, however at present, if I try this the actual background table gets the tooltips, so if I scroll the table the tooltips do not appear over the overlay table, they move with the base table in the scroll body.

    I hope this makes sense.

    I have removed the data-original-title attributes from the scroll table columns, which stops the tooltips appearing, however the overlay table doesn't seem to trigger the tooltips.

  • JasonColeyNZJasonColeyNZ Posts: 11Questions: 4Answers: 0

    I am using
    // Initialize Tooltips
    $('[data-toggle="tooltip"], .enable-tooltip').tooltip({container: 'body', animation: false});

    to init the tooltips, but for some reason the overlay table mouse move events are never received by bootstrap? very strange?

  • allanallan Posts: 61,446Questions: 1Answers: 10,053 Site admin

    The issue is that FixedColumns listens for the init event which actually executes after initComplete (since it itself needs to wait for the table initialisation to be complete!).

    That is something I plan to address in future, but at the moment you could add a little setTimeout wrapper around your tooltip code.

    Allan

  • JasonColeyNZJasonColeyNZ Posts: 11Questions: 4Answers: 0

    Do you know why it is that the overlay table cannot process mouse over events etc, are they somehow disabled in the FixedColumns code somewhere.

    $('[data-toggle="tooltip"], .enable-tooltip').tooltip({container: 'body', animation: false});

    This line will not init the tooltips on the Overlay table.

  • allanallan Posts: 61,446Questions: 1Answers: 10,053 Site admin
    Answer ✓

    Probably similar to the issue being discussed here. You need to run that code after the fixed column has been created since it is looking for static elements rather than being a delegated event handler. My suggestion is to use a delegated event handler if you can.

    Allan

  • JasonColeyNZJasonColeyNZ Posts: 11Questions: 4Answers: 0

    OK thank you, the answer was to...

    $('body').tooltip({ selector: '[data-toggle="tooltip"]', container: 'body', animation: false });

    Which works like a substitute for live/on

This discussion has been closed.