[jQuery] Re: TableSorter properties

2007-09-17 Thread Christian Bach
Hi Rigent,

Try this:

Change: table id=#sorttable

To: table id=sorttable


I will be releasing version 2.0.1 of tablesorter today or tomorrow with
support for jQuery 1.2.

/christian


2007/9/15, Rigent [EMAIL PROTECTED]:



 I'm loving the tablesorter plugin, everything works splendidly except I
 can't
 get a column to sort dates.

 Here's the init function I'm using to:
 - set the two CSS classes for the active TH,
 - disable sorting on the first column,
 - sort the 5th column by date,
 - force the first column sort onload, and
 - adding the Zebra rows widget.

 $(#sorttable).tablesorter( {cssAsc:sortasc,cssDesc:sortdesc,
 headers:
 {0: {sorter: false}, 4: {sorter: date}}, sortList: [[1,0]], widgets:
 ['zebra']} );

 All of these work except the date sorting. I'm using the same date format
 used in the example on tablesorter.com and I've tried all the different
 ways
 to apply it that I can think of or that I've seen here in discussions.
 There's a great variety of examples, including putting '{sorter: date}'
 as
 a class in the TH!

 I was using JQuery 1.2 but the Zebra plugin seems to have a problem under
 1.2 so I'm using an earlier version.

 I must be missing something as I'm not normally this clueless but it just
 won't work for me. Here's an example of the table I'm using:

 table id=#sorttable
thead
 tr
   th width=7% class=nosortnbsp;/th
   th width=20%Initiative/th
   th width=18%Lead Agency /th
   th width=40%Description/th
   th width=15%Last Updated /th
 /tr
/thead
tbody
 tr
   td valign=top # Edit /td
   td valign=top view.php?id= A Name of the Initiative
 /td
   td valign=topOrganization name/td
   td valign=topPromoting healthy lifestyles.../td
   td valign=topApr 24, 2007 /td
 /tr
 tr
   td valign=top # Edit /td
   td valign=top view.php?id= B Name of the Initiative
 /td
   td valign=topOrganization name/td
   td valign=topA program designed.../td
   td valign=topJul 21, 2007 /td
 /tr
 etc

 Any advice gratefully received, thanks!
 --
 View this message in context:
 http://www.nabble.com/TableSorter-properties-tf4445562s15494.html#a12684633
 Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: TableSorter properties

2007-09-17 Thread Rigent


Oops, thanks Christian, that error was only in the post though, not in the
actual HTML I'm using.

If there's nothing fundamentally wrong with my init function I'll wait and
see if your updates tomorrow fix it.

Thanks again for your work on this plugin.

Cheers




Christian Bach wrote:
 
 Hi Rigent,
 
 Try this:
 
 Change: table id=#sorttable
 
 To: table id=sorttable
 
 
 I will be releasing version 2.0.1 of tablesorter today or tomorrow with
 support for jQuery 1.2.
 
 /christian
 

-- 
View this message in context: 
http://www.nabble.com/TableSorter-properties-tf4445562s15494.html#a12737751
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: TableSorter properties

2007-09-17 Thread Christian Bach
Hi,

A very good undocumented feature is a option called debug, which will give
you all kinds of information about what tablesorter is up to.

Try this:

$(#sorttable).tablesorter( {cssAsc:sortasc,cssDesc:sortdesc,
headers:{0: {sorter: false}, 4: {sorter: date}}, sortList: [[1,0]],
widgets:['zebra'], debug: true} );


/christian

2007/9/17, Rigent [EMAIL PROTECTED]:



 Oops, thanks Christian, that error was only in the post though, not in the
 actual HTML I'm using.

 If there's nothing fundamentally wrong with my init function I'll wait and
 see if your updates tomorrow fix it.

 Thanks again for your work on this plugin.

 Cheers




 Christian Bach wrote:
 
  Hi Rigent,
 
  Try this:
 
  Change: table id=#sorttable
 
  To: table id=sorttable
 
 
  I will be releasing version 2.0.1 of tablesorter today or tomorrow with
  support for jQuery 1.2.
 
  /christian
 

 --
 View this message in context:
 http://www.nabble.com/TableSorter-properties-tf4445562s15494.html#a12737751
 Sent from the JQuery mailing list archive at Nabble.com.




[jQuery] Re: TableSorter properties

2007-09-17 Thread Rigent


You have to love undocumented features :)

Using the debugger I noticed that all of my columns were being parsed as
'text' so I downloaded the unpacked JS (I'm not much of a fiddler) and
looked for the parser names the script was looking for. I should have done
this before I assumed that 'date' worked. The actual name in the script is
'isoDate' (or 'usLongDate', or 'usShortDate' depending on your date format).
I used that and it works fine! So 'date' is not a valid parser unless you
add it yourself of course.

For the record, and anyone else searching, I'm using the following init
function and all the features are working perfectly:

$(#sorttable).tablesorter( {cssAsc:sortasc,cssDesc:sortdesc, headers:
{0: {sorter: false},1: {sorter: false},6: {sorter: false},5: {sorter:
isoDate}}, sortList: [[2,0]], widgets: ['zebra']} );

Thanks muchly
Miles



Christian Bach wrote:
 
 Hi,
 
 A very good undocumented feature is a option called debug, which will give
 you all kinds of information about what tablesorter is up to.
 
 Try this:
 
 $(#sorttable).tablesorter( {cssAsc:sortasc,cssDesc:sortdesc,
 headers:{0: {sorter: false}, 4: {sorter: date}}, sortList: [[1,0]],
 widgets:['zebra'], debug: true} );
 
 
 /christian
 
 

-- 
View this message in context: 
http://www.nabble.com/TableSorter-properties-tf4445562s15494.html#a12738873
Sent from the JQuery mailing list archive at Nabble.com.