-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
BugIssues which are marked as BugIssues which are marked as Bug
Description
Bootstraptable version(s) affected
1.24.0
Description
I noticed a weird behaviour using bootstrap tables in a rails app. The table is not displayed properly (no data in the table, duplicated toolbars and paginations, see screenshot below) in the case where I arrived on this page using the back button of the browser. If I refresh the page using the browser, the table is then displayed properly.
Here is the script I used:
<table
id="table"
class="table table-hover"
data-search="true"
data-show-columns="true"
data-filter-control="true"
data-filter-control-container="#filter-container"
data-filter-control-multiple-search="true"
data-pagination="true">
<thead>
<tr>
<th data-field="status" data-filter-control="select" data-sortable="true">Status</th>
<th data-field="name" data-filter-control="input" data-sortable="true" data-switchable="false">name</th>
<th data-field="firstname" data-filter-control="input" data-sortable="true" >firstname</th>
<th data-field="town_name" data-filter-control="input" data-sortable="true">town</th>
</tr>
</thead>
<tbody>
<% @owners.each do |owner| %>
<tr id="<%= dom_id owner %>">
<td><%= t(owner.status).to_s %></td>
<td><%= owner.name.to_s %></td>
<td><%= owner.firstname.to_s %></td>
<td><%= owner.town_name.to_s %></td>
</tr>
<% end %>
</tbody>
</table>
<script>
$(function() {
$('#table').bootstrapTable()
})
</script>
Example(s)
Possible Solutions
I have already tried to change turbo behaviour so page is refreshed when using the back button of the browser but nothing changed.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
BugIssues which are marked as BugIssues which are marked as Bug