Friday, January 13, 2012

jQuery.Colorize 1.7.0

A new version of jQuery.Colorize plugin is available here.

The latest version number is 1.7.0.
This version features a faster load time when the 'rows' option is used.

A plugin demo can be found here.

To use the plugin you need a reference to jQuery library, and the following JavaScript statement:

$(document).ready(function(){
     $('#myTableId').colorize(); }
);

This statement uses default options. Other options are listed in this post.

How to use tablesorter plugin with jQuery.Colorize

If you try to use Colorize plugin along with the wonderful tablesorter plugin with default options, it will work nicely on page load until you try sorting table columns. This will skew all row background coloring. The proper way to use both plugins together is to use the tablesorter 'zebra' widget for alternative row coloring, and the altColor:'none' option in Colorize plugin. Don't forget to declare a style for odd rows in your stylesheet, e.g.: tr.odd {background:#ECF6FC;}.

A usage example:

$("#myTable").tablesorter( {widgets: ['zebra'] }). colorize({ banDataClick: true,  altColor: 'none'});