In most cases, you never want to call the same plug-in twice on a set of
jQuery objects that initialize a behavior on the page (you called
tablesorter() twice in your "incorrect" example.) This is because in most
cases you're applying the behavior twice and may end up with really bizarre
results.

-Dan

>-----Original Message-----
>From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>Behalf Of shoo
>Sent: Tuesday, May 20, 2008 9:22 AM
>To: jQuery (English)
>Subject: [jQuery] Tablesorter - Disabled Header Options with Pager
>
>
>This week I've been working on implementing Tablesorter. It's a great
>Jquery table sorting utility, but I spent quite a bit of time trying
>to figure out why I could only sort columns in descending order while
>using the pager plugin when I set the header option to disable some
>columns. I didn't see anything on here about it so, I thought I would
>post my fix / solution.
>
>Below, the incorrect way to do it.
>
>$(document).ready(function() {
>    $("#SearchResultsTable").tablesorter({
>        // pass the headers argument and assing a object
>        headers: {
>
>            0: {
>                // disable it by setting the property sorter to false
>                sorter: false
>            },
>            4: {
>                // disable it by setting the property sorter to false
>                sorter: false
>            }
>        }
>    })
>.tablesorter({widthFixed: true, widgets: ['zebra']})
>.tablesorterPager({
>       container: $("#ctl00_MainContent_pager"),
>       positionFixed: false
>     }); ;
>});
>
>From what I've discovered, you really need to pass all the parameters
>in one pass like below:
>
>$(document).ready(function() {
>    $("#SearchResultsTable")
>     .tablesorter({
>       headers: {0: {sorter: false},6: {sorter: false}},
>       widgets: ['zebra']
>     })
>       .tablesorterPager({
>       container: $("#ctl00_MainContent_pager"),
>       positionFixed: false
>     });
>});
>
>Above, I am calling table sorter to disable columns 0 and 6, use the
>zebra widget, then call the tablesorter Pager plugin.

Reply via email to