Thanks for this although this looked slightly different on mine and
never had the .each loop
$("tr:visible",table.tBodies[0])
.filter(':even')
.removeClass(table.config.widgetZebra.css[1]).addClass
(table.config.widgetZebra.css[0])
.end().filter(':odd')
.removeClass(table.config.widgetZebra.css[0]).addClass
(table.config.widgetZebra.css[1]);
if(table.config.debug) {
$.tablesorter.benchmark("Applying Zebra
widget", time); }
I changed it too:
var tbodyfix = $("tr", table.tBodies[0]);
if ($(tbodyfix).css("display") !== "none" && $(tbodyfix).css
("visibility") !== "hidden") {
$(tbodyfix)
.filter(':even')
.removeClass(table.config.widgetZebra.css[1]).addClass
(table.config.widgetZebra.css[0])
.end().filter(':odd')
.removeClass(table.config.widgetZebra.css[0]).addClass
(table.config.widgetZebra.css[1]);
if(table.config.debug) { $.tablesorter.benchmark("Applying
Zebra
widget", time); }
}
Seems to fix it and works fine.
On Mar 9, 3:14 pm, MorningZ wrote:
> So the new jQuery code for the filter ":visible" breaks the
> tablesorter's built in Zebra functionality... kind of a hacky fix, but
> at least it works with a minor change
>
> at the end if the tablesorter.js file is the addWidget code for zebra,
> change
>
> $("tr:visible", table.tBodies[0]).each(function(i) {
> // existing code inside this loop
>
> });
>
> to
>
> $("tr", table.tBodies[0]).each(function(i) {
> if ($.css(this, "display") !== "none" && $.css(this,
> "visibility") !== "hidden") {
> // existing code inside this loop
> }
>
> });
>
> so pretty much took the selector code from 1.3 and used that inside of
> ":visible", not sure if that's the best fix ever, but it does make the
> widget act as it's supposed to