Closed jarrettyew closed 6 years ago
@yewness try add this in layout
%meta name="turbolinks-cache-control" content="no-cache"
@mkhairi Thanks it works. Doesn't this remove the caching for each layout? Seems like it will take a little bit longer to load it up.
yeah.. there is another way to fix this. https://m.phillydevshop.com/turbolinks-5-and-datatables-a882c29d6eff
$(document).on 'turbolinks:before-cache', ->
dataTable = $($.fn.dataTable.tables(true)).DataTable()
if (dataTable != null)
dataTable.destroy();
dataTable = null;
How about code where no turbolinks is used? I am using django and htmx and experiencing the same issue
I was navigating the page from dataTable to the show page. Once I clicked back button in the browser, the search and pagination from dataTable were duplicated as shown below.
I believe it's related to caching issue, just have no idea how to make it consistent along the way. What I did after that is to make sure it reloads the whole page if the number of datatable is more than 1. It solves the problem temporarily. I just wonder if there's a way to make sure the flow is seamless even the back button is pressed.