GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
JQuery::TableSorter(3) User Contributed Perl Documentation JQuery::TableSorter(3)

JQuery::TableSorter - The JQuery TableSorter

    use JQuery ; 
    use JQuery::TableSorter ; 

    # define JQuery
    my $jquery = new JQuery ; 


    # Create data for the table
    my $data = [['Id','Total','Ip','Time','US Short Date','US Long Date'],
                ['66672',  '$22.79','172.78.200.124','08:02','12-24-2000','Jul 6, 2006 8:14 AM'],
                ['66672','$2482.79','172.78.200.124','15:10','12-12-2001','Jan 6, 2006 8:14 AM'],
                ['66672',  '$22.79','172.78.200.124','08:02','12-24-2000','Jul 6, 2006 8:14 AM'],
                ['66672','$2482.79','172.78.200.124','15:10','12-12-2001','Jan 6, 2006 8:14 AM']
               ] ;

    $jquery->add_css(new JQuery::CSS( hash => {
                                         '#table1' => {width => '900px', 'font-size' => '15px'}
                                        })) ; 

    # Create a TableSorter, add it to JQuery, and get the result as HTML
    my $tableHTML = JQuery::TableSorter->new(id => 'table1', 
                                             addToJQuery => $jquery,
                                             data => $data, 
                                             dateFormat=>'dd/mm/yyyy', 
                                             sortColumn => 'Total', 
                                             sortClassAsc => 'headerSortUp', 
                                             sortClassDesc => 'headerSortDown',
                                             headerClass => 'header',
                                             stripingRowClass =>  ['even','odd'],
                                             stripRowsOnStartUp => 'true',
                                             #highlightClass => 'highlight', 
                                             disableHeader => 'true'
                                             ))->HTML ; 
    # Get the JQuery code
    my $code = $jquery->get_jquery_code ;

    # Get the CSS
    my $css = $jquery->get_css ;  

    # All that needs to be done is to place the html, jquery code and css in a template

This module defines a table which is sorted when the user clicks the header. There are two builtin styles, to use them you have to set:

    headerClass => 'header',
    sortClassAsc => 'headerSortUp', 
    sortClassDesc => 'headerSortDown',

or

    headerClass => 'headerSimple',
    sortClassAsc => 'headerSimpleSortUp', 
    sortClassDesc => 'headerSimpleSortDown',

To see them, run the jquery_tablesorter1.pl and jquery_tablesorter2.pl examples.

In any event, you can always add CSS afterwards to change the appearance.

This module is based on the JQuery TableSorter. Definitive information for TableSorter can be found at <http://motherrussia.polyester.se/jquery-plugins/tablesorter/>. Examples can be found at <http://motherrussia.polyester.se/pub/jquery/tablesorter/1.0.3/docs/>.

id id - css id - mandatory
data data - a double array containing the data - mandatory
headerClass headerClass - the name of the css class defining the header
dateFormat dateFormat - format to display the date 'dd/mm/yyyy'
sortColumn sortColumn - String of the name of the column to sort by.
sortClassAsc sortClassAsc - headerSortUp - Class name for ascending sorting action to header
sortClassDesc sortClassDesc - headerSortDown - Class name for descending sorting action to header
headerClass headerClass -header Class name for headers (th's)
highlightClass highlightClass - highlight - class name for sort column highlighting.
headerClass headerClass - header Class name for headers (th's)=back
stripingRowClass stripingRowClass - class
disableHeader disableHeader - true/false

HTML
Get the HTML text for the object
new
Instantiate the object

Peter Gordon, "<peter at pg-consultants.com>"

Please report any bugs or feature requests to "bug-jquery-taconite at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=JQuery>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.

    perldoc JQuery

You can also look for information at:

  • AnnoCPAN: Annotated CPAN documentation

    <http://annocpan.org/dist/JQuery>

  • CPAN Ratings

    <http://cpanratings.perl.org/d/JQuery>

  • RT: CPAN's request tracker

    <http://rt.cpan.org/NoAuth/Bugs.html?Dist=JQuery>

  • Search CPAN

    <http://search.cpan.org/dist/JQuery>

Copyright 2007 Peter Gordon, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.