Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter deamon3489

    (@deamon3489)

    Hy Tobias, just a little update on this.

    So i managed to solve it :), Using this snippet worked.

    jQuery(document).on('init.dt', 'table.all-petinsurance-prov-rev', function () {
    jQuery(this).on('draw.dt', function () {
    if (typeof GLSR !== 'undefined') {
    GLSR.Event.trigger('site-reviews/init');
    }
    });
    });

    Since the table allows us to insert a custom class, I added check on the document first for the table and once that happens, another even listener for the table once it intializes to re-trigger the site reviews event.

    Posting this here, so it could help someone else as well.

    Thank you for all the help again,
    Cheers.

    Thread Starter deamon3489

    (@deamon3489)

    Hy paul thank you for the reply, this worked, I totally missed this easy solution 🙂

    I attached some extra lines to the code, so that instead of it directly checking for the draw.dt, it first attachs to document, listens for the draw and then triggers the event on the table. Just a simple draw check wasn’t working as i had the snippet in the header and the table wasn’t initialized by then, so doing it this way worked.

    jQuery(document).on('init.dt', 'table.all-petinsurance-prov-rev', function () {
    jQuery(this).on('draw.dt', function () {
    if (typeof GLSR !== 'undefined') {
    GLSR.Event.trigger('site-reviews/init');
    }
    });
    });

    Thank you again for the help,
    Cheers.

    • This reply was modified 5 months, 2 weeks ago by deamon3489.
    Thread Starter deamon3489

    (@deamon3489)

    Hy, I also reached out to tablepress support and this is what they have told me –

    This is a consequence of how your Site Reviews plugin’s JavaScript code works. For a technical explanation, see https://datatables.net/faqs/index#events

    Essentially, the plugin will need to switch to using “Event Delegation” in its JavaScript code.

    Thread Starter deamon3489

    (@deamon3489)

    Thank you for the reply Tobias,
    I have forwarded this to the site review plugin support forum. Hopefully they will be able to help with this.

    Thank you

    • This reply was modified 5 months, 2 weeks ago by deamon3489.
Viewing 4 replies - 1 through 4 (of 4 total)