The problem with Zebra Striping widget in tablesorter is because it
uses a little bit of xpath, which has been taken out of jQuery 1.2, to
fix this replace the format function on line 819 or around there with

$("> tbody:first > tr:visible",table)
  .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])
;
I've changed the way it works, benchmarks show that this method is
faster
If you want to keep the same function the simpler change is to replace
the / with > in the jQuery expression its around about the same line.

I've also noticed that if you have any events bound to items within
the table, they are lost on sort. After some kind help from Brandon
Aron we worked out that the changes to the empty() in 1.2 is much
better on memory management and cleans the bound events from the
browser. To fix this change around line 245 to
  tableBody = $("tbody:first",table),
  rows = [];
  tableBody.innerHTML = '';

This has been tested in most browsers but needs to be checked out
fully by Christian Bach developer of tablesorter, I've not seen him
online for a while, but as soon as I do I'll point him in this
direction.

Hope this helps.

On Sep 14, 9:39 pm, pixelwizzard <[EMAIL PROTECTED]> wrote:
> Hi all I just ran into a problem with Tablesorter and JQuery 1.2 now
> working with the zebra.  had to go back to JQuery 1.1.3.  Anyone know
> what happened?
>
> On Sep 11, 9:09 am, rortelli <[EMAIL PROTECTED]> wrote:
>
> > Hi all,tablesorter2.0 has some strange behaviours with jQuery 1.2, thezebra
> > stripes seems not to work correctly... ;)
>
> > On Sep 10, 11:55 am, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > Hello,
>
> > > On 20 aug, 11:33, lukek <[EMAIL PROTECTED]> wrote:
>
> > > > By the way I had another question. -- In the unpacked version of the
> > > > latest script your comment on line 555 says "apply easy methods that
> > > > trigger binded events".
>
> > > > Does this mean I can insert function calls in here - ie around line
> > > > 560?
>
> > > > I say this because I have added a call to applyWidget() as I reckon
> > > > all the widgets should be reloaded when the update event is triggered
> > > > - eg after I insert rows I want to reapply thezebrawidget.
>
> > > I'm not sure if this helps anyone, but as this thread gave some
> > > pointers for my issue, here goes:
>
> > > I also wanted to reapply thezebrawidget each time I add rows to the
> > > table. However in my case the rows are coming from an AJAX query,
> > > similar tohttp://tablesorter.com/docs/example-ajax.html
> > > The example there just applies a defined sorting when new data arrives
> > > with triggering "sorton" (after "update") - this will also reapply the
> > >zebrafrom the sort operation. However I didn't want to loose the
> > > sorting that the user might have had already changed to, away from the
> > > default, and I wanted the arriving data to get sorted into the pre-
> > > existing data according to the sort selection. I didn't find a good
> > > way to get to the configuration saved, so I just ended up with this:
>
> > > $("table").trigger("update");
> > > var current_sort = $("table.tablesorter").get(0).config.sortList;
> > > $("table").trigger("sorton", [current_sort]);
>
> > > Hopefully there already is (that I don't know of yet), or will be, a
> > > good way to keep the sorting selection in tact. Maybe something like
> > > this in tablesorter2 itself:
>
> > > $this.bind("resort", function(e) {
> > >     // update header count index
> > >     updateHeaderSortCount(this,sortList);
>
> > >     //set css for headers
> > >     setHeadersCss(this,$headers,config.sortList,sortCSS);
>
> > >     // sort the table and append it to the dom
> > >     appendToTable(this,multisort(this,config.sortList,cache));
>
> > > });
>
> > > Some of these calls (like setHeadersCss) is probably not necessary
> > > from just a resort, as everything in the headers remains the same.
>
> > > Best Regards,
> > > Mart Raudsepp

Reply via email to