To clarify, the first part of the jquery selector -
$('table.tablesorterLQ') - translates to English as "Select any table
with the class of tablesorterLQ". That is why you don't need to
iterate over the multiple tables or use the id attribute. It is
already selecting all of those tables and applying the tablesorter
functionality to them.

Matt

On Jan 11, 2008 8:36 PM, Sonny Savage <[EMAIL PROTECTED]> wrote:
> You can skip the array creation and loop from the first part of my example,
> and pretty much copy what Matt did:
> <script type="text/javascript" src="jquery.js"></script>
> <script type="text/javascript" src="jquery.tablesorter.min.js"></script>
> <script type="text/javascript">
> $(document).ready(function(){
>        $('table.tablesorterLQ').tablesorter({sortList: [[0,0],[0,1]],
> widgets: ['zebra']});
> });
> </script>
>
>
>
> On Jan 11, 2008 8:24 PM, Paul Ihrig <[EMAIL PROTECTED]> wrote:
>
> > ok.
> > thanks guys
> > i will look at it once my eyes relax a bit.
> >
> > so should i first
> > var aSortTables = $("table.tablesorterLQ");
> >       for ( var i = 1; i < aSortTables.length; i++ )
> >
> > to creat the +1 count?
> > or is this not needed.
> > i am not familar with the short cut you mentioned.
> >
> > i dont see in Matts test where the i is invoked in the top part of the js?
> > sorry if i dont make any sense.
> >
> >
> > On Jan 11, 2008 4:34 PM, Matt Williams <[EMAIL PROTECTED]> wrote:
> >
> > > On Jan 11, 2008 2:43 PM, Sonny Savage <[EMAIL PROTECTED]> wrote:
> > > > jQuery might even have a shortcut that assigns all the elements of the
> > > array
> > > > at once:
> > > > $("table.tablesorterLQ").tablesorter({sortList:[[0,0],[0,1]], widgets:
> > > > ['zebra']});
> > >
> > > Sonny is right. What he has should work. Here is some code I have that
> > > makes the 2 tables sortable.
> > >
> > > <link rel="stylesheet" type="text/css" media="screen" href="style.css"
> > > charset="utf-8" />
> > > <script src="jquery.js" type="text/javascript"></script>
> > > <script type="text/javascript" src="jquery.tablesorter.min.js"></script>
> > > <script type="text/javascript">
> > > $(document).ready(function(){
> > >        $('.tablesorter').tablesorter({
> > >                sortList: [[0,0],[0,1]],
> > >                widgets: ['zebra']
> > >                });
> > > });
> > > </script>
> > >
> > > <cfoutput>
> > > <cfloop from="1" to="2" index="i">
> > >        <table class="tablesorter" id="tblRep#i#">
> > >                <thead>
> > >                <tr>
> > >                        <th>name</th>
> > >                        <th>number</th>
> > >                </tr>
> > >                </thead>
> > >                <tbody>
> > >                <tr>
> > >                        <td>Aaron #i#</td>
> > >                        <td>20</td>
> > >                </tr>
> > >                <tr>
> > >                        <td>Bill #i#</td>
> > >                        <td>10</td>
> > >                </tr>
> > >                </tbody>
> > >        </table>
> > > </cfloop>
> > > </cfoutput>
> > >
> > > --
> > > Matt Williams
> > > "It's the question that drives us."
> > >
> > >
> >
> >
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296470
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to