-
Notifications
You must be signed in to change notification settings - Fork 753
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
Widget classes don't apply to part of table #224
Comments
I think you might be missing the <link rel="stylesheet" href="./css/theme.jui.css" /> Also, since it doesn't look like you're using it, the |
Main page that i posted it's a compilation of code from a another script, where i use metadata. I posted that code compilation coz with it i still can reproduce the bug, so i thought that will be enough, to show what kind of bug i'm met. Here i added theme.jui.css (i made a screen wil all included css files) to a sample code, listed above, still no zebra: If i click on any header, to sort table differently, all classes will be applied, like they supposed to be: also, if i remove $( "#tabs" ).tabs(); and tabs not gonna be created, table will be load like supposed to be, with all classes, and zebra widget: Based on that i still think that this is a bug. |
Hmm, that is very odd... I don't have time today to make a demo to test this situation, but I wonder what would happen if you added a method to update the widgets after initialization: $("#activity_table").tablesorter().trigger('applyWidgets'); You shouldn't need to do that, but I wonder if there is some memory leak or something with the tab contents being replaced. Have you tried jQuery 1.9 yet? |
I updated it for test: <script src="http://code.jquery.com/jquery-1.9.0.js"> And result still: I underlined two places. One, your code, second non-standard class applied to a table. I added this class in extending tablesorter theme defaults: $.extend($.tablesorter.themes.jui, {
table : 'ui-widget ui-widget-content ui-corner-all table-borders', and table rescieve this class as it should be. All rows in tbody - still no classes by default. They appear only after sorting. |
Oops, i think i made mistake, by applying .tablesorter() two times. |
Oh, I know! It's because the zebra widget only applies to visible rows, and the table isn't visible until you click on that tab. So, add this to your tabs function: $( "#tabs" ).tabs({
activate: function( event, ui ) {
ui.newPanel.find("#activity_table").trigger('applyWidgets');
}
}); |
Thanks. A lot. |
You're welcome! :) |
Hi, I'm using tablesorter in combination with jQuery tabs, and some of them loaded via jQuery ajax.
All the tables on page, placed in different tabs. And tables, that loaded in tab with jQuery ajax, don't loading correctly.
Here is the example screen, of page with that bug: http://www.diigo.com/item/image/3mh9g/kbxq
Here is screen of page code, made with Firebug: http://www.diigo.com/item/image/3mh9g/dp8t
Main table, and all rows in thead have required css classes, tbody>td doesn't have any css class.
If i sort this table, all classes appears, but how to make them appear in default state?
If you need source code of pages, here they are:
Main page, with tabs:
File included via ajax, testtable.php:
The text was updated successfully, but these errors were encountered: