TableSorter plugin parsing control

If you need to force the column type for the tablesorter control, the documentation says to use metadata classes like so:

 <th class="{sorter: 'text'}">first name</th> 

This is a pain to try to do in an XSLT, so I found another way.  This is how you force column type during tablesort initialization:

$(document).ready(function(){
	$(".tablesorter").tablesorter({
		widgets:['zebra'],
		headers: {
			1: { sorter : 'text' }
		}
	});
});

The column position is zero based, so this is forcing the sorter for the second column.

For more information, see:

http://www.terminally-incoherent.com/blog/2008/09/29/jquery-tablesorter-list-of-builtin-parserssorters/#comment-22114

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s