views:

190

answers:

2

Sorry if this has already been solved elsewhere but my searches have been able to turn up nothing and my attempts at solving the issue myself have made even less progress. :P

Put quite simply I have a table that is using the jquery tablesorter and it's zebra widget. In this table there is a hidden column. I've so far been able to make it so that when a tr contains specific text (I was aiming for * but was seemingly unable to get \* to work for whatever reason...and I suspect my selector is perhaps not specific enough) the containing row is set not to display by ".hide()".

The problem I am having though is when the row is hidden, tablesorter does exactly what it should do and stripes all the rows their specific colours based on their odd and even values. Of course .remove doesn't do the trick either as the table still sees some funny striping.

Any thoughts on how to make it so that when a row is hidden, the striping compensates?

+1  A: 
$('table').find('tr:visible').doSomething()

should do it?

Kind Regards

--Andy

jAndy
You'd think so. xD Though the selector I've used to hide the row is if tr contains text then hide, but that is what ends up messing the striping. The hiding or removing I can manage without a problem. Its forcing the rows to be striped correctly or in other words make the hidden row now count in the striping I guess..trigger("update") doesn't seem to do the trick either but I do not know if I am using it correctly. xD
Harvengure
+1  A: 

I know the post is old, but I found it while trying to solve the problem myself...

ended up using this:

$('table tr').removeClass('alt');
$('table tr:visible:even').addClass('alt');

and so far it's working like a charm.

blindworld
Thanks for that solution blindworld, helped me.
Ivan Kruchkoff