Bootstrap-table: Header and footer duplicated when going back a page when using rails turbolink

Created on 10 Aug 2017  路  4Comments  路  Source: wenzhixin/bootstrap-table

Hello,
I was having a lot of fun until I hit this one up:).

This happens on my rails app only when I go back to the table's page.

Turbolinks seems to be the problem.

image

Both header (search row) and footer (pagination links row) keep multiplying (see below) each time I go forth and then again back, until I actually either refresh or access the table page via its link.

image

Thank you so much for this fantastic work!!!

Luca

awaiting reply needs example

Most helpful comment

Don't forget to destroy BT before caching:

$(document).on("turbolinks:before-cache", function() {

    $('[data-toggle="table"]').bootstrapTable('destroy');

});

All 4 comments

Please provide a jsFiddle to show your problem, thanks!

Hi! We don't have any reply in that case we are going to close this issue. If the issue is still present please open a new Issue or PR. Thanks!

Don't forget to destroy BT before caching:

$(document).on("turbolinks:before-cache", function() {

    $('[data-toggle="table"]').bootstrapTable('destroy');

});

@Bighamster The trigger won't be fired if you press F5 :-/ or if you redirect_to in controller to the same page

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sxahmed picture sxahmed  路  19Comments

cgountanis picture cgountanis  路  14Comments

thongkekienthuc12 picture thongkekienthuc12  路  16Comments

jesussuarz picture jesussuarz  路  17Comments

thibaultvanc picture thibaultvanc  路  20Comments