[jQuery] Re: Problem with Tablesorter Pager plugin - there should be an option to turn off absolute positioning of pager container

2008-09-09 Thread Eric

Try adding the option positionFixed: false, like so:

tablesorterPager({container: $("#pager"),positionFixed: false});

Here are the other defaults:
this.defaults = {
size: 10,
offset: 0,
page: 0,
totalRows: 0,
totalPages: 0,
container: null,
cssNext: '.next',
cssPrev: '.prev',
cssFirst: '.first',
cssLast: '.last',
cssPageDisplay: '.pagedisplay',
cssPageSize: '.pagesize',
seperator: "/",
positionFixed: true,
appender: this.appender
};

On Aug 20, 7:05 pm, ptepper <[EMAIL PROTECTED]> wrote:
> In the Tablesorter Pager plugin, on line 25, the position of the pager
> UI container is always set to absolute. In some cases, you want it to
> be positioned differently -- I embedded a table in a page with a lot
> of other preexisting content, and the pager was placed on top of some
> other elements. I removed the absolute position part myself, but it
> shouldn't be set to absolute by default.
>
> On a related note, the documentation for the Pager is unclear. It's
> not obvious that you have to create all the Pager elements yourself.
> You have to look at the source code for the page to see how it's
> working, and it's not clear that you're supposed to create all the
> images and form elements yourself. There should be some instructions
> stating that you need to copy this code, or something like it, to make
> the pager work. Many jQuery plugins just require you to specify an Id
> for a container, and add code like this automatically, and there's no
> instructions telling you to download or create the images (the PNGs
> here) and set all this up:
>
> 
>         
>                  class="first"/>
>                 
>                 
>                 
>                 
>                 
>                         10 option>
>
>                         20
>                         30
>                         40
>                 
>         
> 
>
> Otherwise, the plugin is great - works perfectly and is faster than
> any other similar things I've tried in other Javascript frameworks.


[jQuery] Re: problem with tablesorter and dynamic table content

2008-04-08 Thread Jonny Polite

Building the entire table in the javascript is more annoying, but it
definitely worked.  Thanks.

On Apr 5, 11:04 pm, Matt Grimm <[EMAIL PROTECTED]> wrote:
> I also ran across this issue with dynamically loaded tbody content. I
> came to the conclusion, after poring over the tablesorter source code,
> that the only solution is to rebuild the entire table with each
> dynamic reload. The idea was originally posted here:
>
> http://groups.google.com/group/jquery-en/browse_thread/thread/32732ee...
>
> On Apr 3, 1:05 pm, Jonny Polite <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > So I have this table where the  is initially blank.  Then when
> > the document is ready I call a function that runs an AJAX query for
> > the table content.
>
> > The initial content is sorted awesomely!  But when I call my function
> > again with different parameters to get new content, things start to go
> > wrong.  The table fills with the new content just fine, but clicking
> > on a header column to sort reverts the table content back to what it
> > was when the page first loaded.
>
> > As you can see below, I have some logic in there to call
> > the .trigger("update") any time the content is updated.  It just
> > doesn't seem to be doing the trick.  It's liketablesorternever
> > figures out that there is new content it should be sorting with.
>
> > Has anyone ever encountered this?  Is there a solution or have I
> > simply encountered a bug?  I really hope someone has something I could
> > try.  Below it the relevant code for your perusal.
>
> > 
> > The initial table looks like this:
> > 
> > 314 
> > 315 
> > 316 
> > 317 category
> > 318 name
> > 319 description
> > 320 active
> > 321 viewable
> > 322 end user viewable
> > 323 OST bucket
> > 324 
> > 325 
> > 326 
> > 327 
> > 328  > value="save changes" />
> > 329 
> > 330 
> > 331 
> > 332 
> > 333 
>
> > 
> > The bulk of the function work happens within the success section of
> > the AJAX call.  The success part looks like this:
> > 
> > 143 success:function(data) {
> > 144 var issue_data = eval( "("+data+")" );
> > 145
> > 146 var issue_table = $j("#issue_table");
> > 147
> > 148 // Clear out whatever's in the table body
> > 149 var tbody = $j("#issue_table tbody");
> > 150 tbody.empty();
> > 151
> > 152 $j.each( issue_data, function() {
> > 153 var issue_string =  " > color:#EFF8FF\">";
> >  code that constructs an entire TR as a string
> > 167
> > 168 tbody.append( issue_string );
> > 169 });
> > 170
> > 171 // Sort the table
> > 172 if( update ) {
> > 173 issue_table.trigger("update");
> > 174 var sorting = [[0,0]];
> > 175 issue_table.trigger("sorton", [sorting]);
> > 176 } else {
> > 177 issue_table.tableSorter({
> > 178 debug:  true,
> > 179 sortColumn: 'name',
> > 180 sortClassAsc:   'issue_header_asc',
> > 181 sortClassDesc:  'issue_header_desc',
> > 182 headerClass:'issue_header'
> > 183 });
> > 184 }
> > 185
> > 186 }


[jQuery] Re: problem with tablesorter and dynamic table content

2008-04-05 Thread Matt Grimm

I also ran across this issue with dynamically loaded tbody content. I
came to the conclusion, after poring over the tablesorter source code,
that the only solution is to rebuild the entire table with each
dynamic reload. The idea was originally posted here:

http://groups.google.com/group/jquery-en/browse_thread/thread/32732eecb8570dc0/26afe765f4a12c7b?lnk=gst&q=tablesorter


On Apr 3, 1:05 pm, Jonny Polite <[EMAIL PROTECTED]> wrote:
> Hello,
>
> So I have this table where the  is initially blank.  Then when
> the document is ready I call a function that runs an AJAX query for
> the table content.
>
> The initial content is sorted awesomely!  But when I call my function
> again with different parameters to get new content, things start to go
> wrong.  The table fills with the new content just fine, but clicking
> on a header column to sort reverts the table content back to what it
> was when the page first loaded.
>
> As you can see below, I have some logic in there to call
> the .trigger("update") any time the content is updated.  It just
> doesn't seem to be doing the trick.  It's liketablesorternever
> figures out that there is new content it should be sorting with.
>
> Has anyone ever encountered this?  Is there a solution or have I
> simply encountered a bug?  I really hope someone has something I could
> try.  Below it the relevant code for your perusal.
>
> 
> The initial table looks like this:
> 
> 314 
> 315 
> 316 
> 317 category
> 318 name
> 319 description
> 320 active
> 321 viewable
> 322 end user viewable
> 323 OST bucket
> 324 
> 325 
> 326 
> 327 
> 328  value="save changes" />
> 329 
> 330 
> 331 
> 332 
> 333 
>
> 
> The bulk of the function work happens within the success section of
> the AJAX call.  The success part looks like this:
> 
> 143 success:function(data) {
> 144 var issue_data = eval( "("+data+")" );
> 145
> 146 var issue_table = $j("#issue_table");
> 147
> 148 // Clear out whatever's in the table body
> 149 var tbody = $j("#issue_table tbody");
> 150 tbody.empty();
> 151
> 152 $j.each( issue_data, function() {
> 153 var issue_string =  " color:#EFF8FF\">";
>  code that constructs an entire TR as a string
> 167
> 168 tbody.append( issue_string );
> 169 });
> 170
> 171 // Sort the table
> 172 if( update ) {
> 173 issue_table.trigger("update");
> 174 var sorting = [[0,0]];
> 175 issue_table.trigger("sorton", [sorting]);
> 176 } else {
> 177 issue_table.tableSorter({
> 178 debug:  true,
> 179 sortColumn: 'name',
> 180 sortClassAsc:   'issue_header_asc',
> 181 sortClassDesc:  'issue_header_desc',
> 182 headerClass:'issue_header'
> 183 });
> 184 }
> 185
> 186 }


[jQuery] Re: problem with tablesorter plugin

2008-03-02 Thread Joel Newkirk
I recently addressed the same need with the following code:

$(".listtable").tablesorter();
$(".listtable").bind("sortStart",function() {
$("#busybar").fadeIn(400);
}).bind("sortEnd",function() {
$(".listtable tr:odd").removeClass("alterow");
$(".listtable tr:even").addClass("alterow");
$("#busybar").fadeOut(400);
});
$(".listtable tr:even").addClass("alterow");
$(".listtable
tr").hover(function(){$(this).addClass("hoover")},function(){$(this).removeClass("hoover")});


The tr:even line near the bottom should be unnecessary if you define an
initial sort column/direction for the table, since that will entail a sort
taking place onload.  So I fade in the animgif 'busy' on sortStart (some of
my tables are several hundred rows of a dozen or two columns, taking several
seconds to sort sometimes) then on sortEnd I remove any 'alterow' class on
odd rows (clears ONLY from even rows that are now odd after sorting) then
applies 'alterow' class to even rows, in practice affecting only odd rows
that are now even, post-sort.  Originally I was clearing 'alterow' from all
then applying to all even rows, but the display update was often more
jarring that way.

Obviously the 'busybar' bit and the hover highlight are not pertinent to
your stated question, just part of the code chunk I've utilized, and
pasted.  (FWIW, 'hoover' is an in-joke - an ex employer of mine consistently
referred to onmouseover events as 'hoovering', and we all joked about it so
much it's sort of stuck ;)

I realize this can be condensed further, but haven't tried.  And I suspect
there's some way to chain the tr:odd and tr:even, but don't know if it would
be worth the effort, given that the odd vs even selection will still need to
take place.

j


> >> >> >> table starts out with alternating row colors.  but once i sort it
> >> by
> >> >> >> clicking on one for the columns. the row colors get all out of
> >> whack.
> >>
> >> >> >> can someone tell me how i can keep the alternating row colors in
> >> order
> >> >> >> after
> >> >> >> the sort?
>


[jQuery] Re: Problem with tablesorter

2008-01-21 Thread Christian Bach
Hi Guys,

I will see to it that i incorporate this into the next bug fix version of
tablesorter.

Thanks for spotting it!

/Christian

2008/1/17, Cesar <[EMAIL PROTECTED]>:
>
>
> I encountered this bug the alternate fix, if you want to use version
> 2.0 of the metadata plugin, is to open up tablesorter, and find/
> replace $.meta/$.metadata and .data()/.metadata().
>
> For the lazy people out there you can grab my version here: (Use at
> your own risk)
> http://blog.codafoo.com/javascripts/jquery.tablesorter.min.js
>
> On Jan 2, 8:51 am, KnoxBaby <[EMAIL PROTECTED]> wrote:
> > got it to work with the version of metadata that comes with the
> > release from tablesorter.com!
> >
> > On 1 Jan., 13:45, KnoxBaby <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> >
> > > after a long discussion with karl about cluetip (http://
> > > groups.google.com/group/jquery-en/browse_thread/thread/
> > > 26229d51487e3bf9/2140d6480c81b21a#2140d6480c81b21a), I have the
> > > problem, that the inline options fortablesorterdon't work anymore:
> >
> > >http://www.jahlabs.de/jquery/test/
> >
> > > e.g. I have set class="{sorter: false}" to the column "Aktion" since
> > > it's stupid to sort after it but that's not recognized anymore ... :(
> >
> > > What's wrong about it???
> >
> > > Thanks :)
>


[jQuery] Re: Problem with tablesorter

2008-01-17 Thread Cesar

I encountered this bug the alternate fix, if you want to use version
2.0 of the metadata plugin, is to open up tablesorter, and find/
replace $.meta/$.metadata and .data()/.metadata().

For the lazy people out there you can grab my version here: (Use at
your own risk)
http://blog.codafoo.com/javascripts/jquery.tablesorter.min.js

On Jan 2, 8:51 am, KnoxBaby <[EMAIL PROTECTED]> wrote:
> got it to work with the version of metadata that comes with the
> release from tablesorter.com!
>
> On 1 Jan., 13:45, KnoxBaby <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > after a long discussion with karl about cluetip (http://
> > groups.google.com/group/jquery-en/browse_thread/thread/
> > 26229d51487e3bf9/2140d6480c81b21a#2140d6480c81b21a), I have the
> > problem, that the inline options fortablesorterdon't work anymore:
>
> >http://www.jahlabs.de/jquery/test/
>
> > e.g. I have set class="{sorter: false}" to the column "Aktion" since
> > it's stupid to sort after it but that's not recognized anymore ... :(
>
> > What's wrong about it???
>
> > Thanks :)


[jQuery] Re: Problem with tablesorter

2008-01-02 Thread KnoxBaby

got it to work with the version of metadata that comes with the
release from tablesorter.com!

On 1 Jan., 13:45, KnoxBaby <[EMAIL PROTECTED]> wrote:
> Hello,
>
> after a long discussion with karl about cluetip (http://
> groups.google.com/group/jquery-en/browse_thread/thread/
> 26229d51487e3bf9/2140d6480c81b21a#2140d6480c81b21a), I have the
> problem, that the inline options for tablesorter don't work anymore:
>
> http://www.jahlabs.de/jquery/test/
>
> e.g. I have set class="{sorter: false}" to the column "Aktion" since
> it's stupid to sort after it but that's not recognized anymore ... :(
>
> What's wrong about it???
>
> Thanks :)