If you’re using Yii2 Gridview with tabs and notice that when the user filters the results, posting the page goes to the wrong tab.

This solution worked great for me:
$(document).ready(function() {
$('a[data-toggle=\"tab\"]').on('show.bs.tab', function (e) {
localStorage.setItem('lastTab', $(this).attr('href'));
var lastTab = localStorage.getItem('lastTab');
if (lastTab) {
$('[href=\"' + lastTab + '\"]').tab('show');

via Maintain Bootstrap Tab on Yii2 Gridview Page Changing

Support this site, share this page:Tweet about this on TwitterShare on RedditShare on LinkedInShare on FacebookEmail this to someone