Mottie/tablesorter — Issue #18: Different effect for setting sorter false for a column
Author: innc
Created: 2011-12-30 20:02:03+00:00
State: open

Hello :)

I noticed a different effect for setting sorter false for a column by two different methods:
(I inserted '.' inside HTML code to display tags here)

Method 1 to disable sorter for column 0:

$("#myTable").tablesorter(
{
widgets : ['uitheme', 'zebra', 'stickyHeaders', 'filter'],
widgetZebra: { css: ["ui-widget-content", "ui-state-default"] },
widgetUitheme: { css: ["ui-icon-carat-2-n-s", "ui-icon-carat-1-s", "ui-icon-carat-1-n"] },

headers:
{
0:
{
sorter: false
}
}
});

This works fine!
Generated table header code is:

<.th class="ui-widget-header ui-corner-all">
<.span><./span>
<.span class=""><./span>
<./th>

Methode 2 to disable sorter for column 0:
-Disable (or set) the column parser using class names
<.th class="sorter-false"><./th>

so you only need this now without an addional headers-option:

$("#myTable").tablesorter(
{
widgets : ['uitheme', 'zebra', 'stickyHeaders', 'filter'],
widgetZebra: { css: ["ui-widget-content", "ui-state-default"] },
widgetUitheme: { css: ["ui-icon-carat-2-n-s", "ui-icon-carat-1-s", "ui-icon-carat-1-n"] }
});

This works almost fine, BUT the look is wrong!
Generated table header code is:

<.th class="sorter-false ui-widget-header ui-corner-all ui-state-active">
<.span><./span>
<.span class="ui-icon"><./span>
<./th>

The sorting for this column is disabled, but ui-state-active is activated and ui-icon is displayed. Both should not be.

I hope you had nice Christmas days and i wish a Happy New Year!
greetings