Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap tabs / inside is not updating => table on tabs will not show if reload with a other active tab #1261

Closed
JoCord opened this issue Jul 20, 2016 · 6 comments

Comments

@JoCord
Copy link

JoCord commented Jul 20, 2016

tablesorter 2.26.6
jquery 2.2.3
bootstrap 3.3.6

my tables on two tabs will not show only if you reload the page with one of this tabs active.

Your answer on stackoverflow contains the following working source:

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {   
  $('.tab-pane.active').find('table').trigger('applyWidgets');  
   $(window).resize();  
});

which works fine.

With the new commit (84180c1) you want to fixed that, but as you wrote:

the inside table isn't updating

Screenshot:
fsi_xp_notable

@Mottie
Copy link
Owner

Mottie commented Jul 20, 2016

Hi @JoCord!

Strangely, I was just looking at this when you posted the issue.

I discovered that the problem is actually the resizable widget. The combination of scroller & resizable widgets are not currently compatible - see #866 (comment).

If you remove the resizable widget, the demo works as expected.

@JoCord
Copy link
Author

JoCord commented Jul 20, 2016

Mottie,

My tablesorter config do not load/activate the "resizable" widget:

    $(document).ready(function () {
       $("#fsi_xpnet")
           .tablesorter({
             theme: "bootstrap",
             showProcessing   : true, 
             headerTemplate: '{content} {icon}',
             widthFixed: true,
             widgets: ["storage", "saveSort", "uitheme", "filter", "scroller"],
             widgetOptions: {
                filter_reset : 'button.reset',
                filter_hideFilters: false,
                filter_ignoreCase: true,
                filter_saveFilters: true,
                filter_cssFilter: "form-control",
                scroller_height: 578,
                scroller_upAfterSort: false,
                scroller_jumpToHeader: false,
             }
       });
}); 

But I use the jquery.tablesorter.combined.js:

<script type="text/javascript" src="[% request.uri_base %]/tablesorter/jquery.tablesorter.combined.js"></script>
<script type="text/javascript" src="[% request.uri_base %]/tablesorter/widget-scroller.js"></script>
<script type="text/javascript" src="[% request.uri_base %]/tablesorter/parser-input-select.js"></script>
<script type="text/javascript" src="[% request.uri_base %]/tablesorter/widget-grouping.js"></script>

Should I load the single files or what you mean with

remove the resizable widget

?

Regards
Jochen

@Mottie
Copy link
Owner

Mottie commented Jul 20, 2016

Oh, it's just that the demo was using the resizable widget when I noticed the inner table wasn't updating. If you run that demo without the resizable widget (in the widgets option), then the demos work as expected.

@JoCord
Copy link
Author

JoCord commented Jul 20, 2016

Mottie,
but in the demo you have the workaround

    $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
        $('.tab-pane.active').find('table').trigger('applyWidgets');
        $(window).resize();
    });

included - is this in the new version also needed?

@Mottie
Copy link
Owner

Mottie commented Jul 20, 2016

Yes, that is still needed for the current release. Once the next release is available, the $(window).resize(); part of the code won't be necessary.


Update: This issue is fixed by 84180c1.

@JoCord
Copy link
Author

JoCord commented Aug 2, 2016

Mottie,

perfect - new version works great!

Thank you & Regards
Jochen

@JoCord JoCord closed this as completed Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants