Mottie / tablesorter

Github fork of Christian Bach's tablesorter plugin + awesomeness ~
https://mottie.github.io/tablesorter/docs/
2.61k stars 754 forks source link

Always sorts using the last column #569

Closed driscojs closed 10 years ago

driscojs commented 10 years ago

When I put a tablesorter into any table, and click on a column header, it always sorts the final column, instead of that column. I created a test page, and loaded the code straight from the jfiddle provided, and still got the same result. After the page loads, and then I click the 'Numeric' column header, then ctrl-clicking to clear the sort (which does clear it) then I clicked'Animals', this is the console log:

Use of getPreventDefault() is deprecated.  Use defaultPrevented instead. jquery.js:3
"Sorting on 3,1 and dir 1 time (1ms)" jquery.tablesorter.js:144
"Rebuilt table (2ms)" jquery.tablesorter.js:144
"Applying Columns widget (2ms)" jquery.tablesorter.js:144
"Applying Zebra widget (3ms)" jquery.tablesorter.js:144
"Completed applying 2 widgets (5ms)" jquery.tablesorter.js:144
"Sorting on  and dir undefined time (1ms)" jquery.tablesorter.js:144
"Rebuilt table (6ms)" jquery.tablesorter.js:144
"Applying Columns widget (4ms)" jquery.tablesorter.js:144
"Applying Zebra widget (4ms)" jquery.tablesorter.js:144
"Completed applying 2 widgets (9ms)" jquery.tablesorter.js:144
"Sorting on 3,1 and dir 1 time (2ms)" jquery.tablesorter.js:144
"Rebuilt table (5ms)" jquery.tablesorter.js:144
"Applying Columns widget (5ms)" jquery.tablesorter.js:144
"Applying Zebra widget (10ms)" jquery.tablesorter.js:144
"Completed applying 2 widgets (15ms)" jquery.tablesorter.js:144

The sort seems to be always sorting the 4th column, #3 of 0-3. Here's the code I'm using:

Controller:

<?php
require_once APPPATH.'/libraries/base_controller.php';
/**
 * 
 * @author Jeff Driscoll
 *
 */

class TablesorterTest extends BASE_Controller 
{
    function __construct()
    {   
        parent::__construct();  
        $this->data['userid'] = $this->session->userdata('user_id');
        $this->tableTemplate = array ('table_open' => '<table id="myTable" class="table table-condensed table-striped">'    );
    }

        public function index()
        {

            //Show page

        $this->data['content_view'] = 'rankings_variance_report/tablesorterTest';
        $this->load->view('show_page',$this->data);
        }
}
?>

View:

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<html>
    <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="/assets/js/bootstrap-tooltip.js"></script>
<script type="text/javascript" src="/assets/js/bootstrap-tab.js"></script>

<script type="text/javascript" src="<?php echo base_url();?>assets/js/tablesorter/jquery.metadata.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/tablesorter/jquery.tablesorter.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/tablesorter/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/tablesorter/jquery.tablesorter.widgets.js"></script>

<style>
        /* This class is added to the span wrapping the
   header text using the "onRenderHeader" option */
 .roundedCorners {
    border: #777 1px solid;
    padding: 0 10px;
    border-radius: 1em;
    -moz-border-radius: 1em;
    -webkit-border-radius: 1em;
}
        </style>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>

        <table class="tablesorter">
    <thead>
        <tr>
            <th>AlphaNumeric</th>
            <th>Numeric</th>
            <th>Animals</th>
            <th>Sites</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>abc 123</td>
            <td>10</td>
            <td>Koala</td>
            <td>http://www.google.com</td>
        </tr>
        <tr>
            <td>abc 1</td>
            <td>234</td>
            <td>Ox</td>
            <td>http://www.yahoo.com</td>
        </tr>
        <tr>
            <td>abc 9</td>
            <td>10</td>
            <td>Girafee</td>
            <td>http://www.facebook.com</td>
        </tr>
        <tr>
            <td>zyx 24</td>
            <td>767</td>
            <td>Bison</td>
            <td>http://www.whitehouse.gov/</td>
        </tr>
        <tr>
            <td>abc 11</td>
            <td>3</td>
            <td>Chimp</td>
            <td>http://www.ucla.edu/</td>
        </tr>
        <tr>
            <td>abc 2</td>
            <td>56</td>
            <td>Elephant</td>
            <td>http://www.wikipedia.org/</td>
        </tr>
        <tr>
            <td>abc 9</td>
            <td>155</td>
            <td>Lion</td>
            <td>http://www.nytimes.com/</td>
        </tr>
        <tr>
            <td>ABC 10</td>
            <td>87</td>
            <td>Zebra</td>
            <td>http://www.google.com</td>
        </tr>
        <tr>
            <td>zyx 1</td>
            <td>999</td>
            <td>Koala</td>
            <td>http://www.mit.edu/</td>
        </tr>
        <tr>
            <td>zyx 12</td>
            <td>0</td>
            <td>Llama</td>
            <td>http://www.nasa.gov/</td>
        </tr>
    </tbody>
</table>

    </body>
</html>
  $('table').tablesorter({

    // *** APPEARANCE ***
    // Add a theme - try 'blackice', 'blue', 'dark', 'default'
    //  'dropbox', 'green', 'grey' or 'ice'
    // to use 'bootstrap' or 'jui', you'll need to add the "uitheme"
    // widget and also set it to the same name
    // this option only adds a table class name "tablesorter-{theme}"
    theme: 'blackice',

    // fix the column widths
    widthFixed: false,

    // Show an indeterminate timer icon in the header when the table
    // is sorted or filtered
    showProcessing: false,

    // header layout template (HTML ok); {content} = innerHTML,
    // {icon} = <i/> (class from cssIcon)
    headerTemplate: '{content}',

    // return the modified template string
    onRenderTemplate: null, // function(index, template){ return template; },

    // called after each header cell is rendered, use index to target the column
    // customize header HTML
    onRenderHeader: function (index) {
        // the span wrapper is added by default
        $(this).find('div.tablesorter-header-inner').addClass('roundedCorners');
    },

    // *** FUNCTIONALITY ***
    // prevent text selection in header
    cancelSelection: true,

    // other options: "ddmmyyyy" & "yyyymmdd"
    dateFormat: "mmddyyyy",

    // The key used to select more than one column for multi-column
    // sorting.
    sortMultiSortKey: "shiftKey",

    // key used to remove sorting on a column
    sortResetKey: 'ctrlKey',

    // false for German "1.234.567,89" or French "1 234 567,89"
    usNumberFormat: true,

    // If true, parsing of all table cell data will be delayed
    // until the user initializes a sort
    delayInit: false,

    // if true, server-side sorting should be performed because
    // client-side sorting will be disabled, but the ui and events
    // will still be used.
    serverSideSorting: false,

    // *** SORT OPTIONS ***
    // These are detected by default,
    // but you can change or disable them
    // these can also be set using data-attributes or class names
    headers: {
        // set "sorter : false" (no quotes) to disable the column
        0: {
            sorter: "text"
        },
        1: {
            sorter: "digit"
        },
        2: {
            sorter: "text"
        },
        3: {
            sorter: "url"
        }
    },

    // ignore case while sorting
    ignoreCase: true,

    // forces the user to have this/these column(s) sorted first
    sortForce: null,
    // initial sort order of the columns, example sortList: [[0,0],[1,0]],
    // [[columnIndex, sortDirection], ... ]
    sortList: [
        [0, 0],
        [1, 0],
        [2, 0]
    ],
    // default sort that is added to the end of the users sort
    // selection.
    sortAppend: null,

    // starting sort direction "asc" or "desc"
    sortInitialOrder: "asc",

    // Replace equivalent character (accented characters) to allow
    // for alphanumeric sorting
    sortLocaleCompare: false,

    // third click on the header will reset column to default - unsorted
    sortReset: false,

    // restart sort to "sortInitialOrder" when clicking on previously
    // unsorted columns
    sortRestart: false,

    // sort empty cell to bottom, top, none, zero
    emptyTo: "bottom",

    // sort strings in numerical column as max, min, top, bottom, zero
    stringTo: "max",

    // extract text from the table - this is how is
    // it done by default
    textExtraction: {
        0: function (node) {
            return $(node).text();
        },
        1: function (node) {
            return $(node).text();
        }
    },

    // use custom text sorter
    // function(a,b){ return a.sort(b); } // basic sort
    textSorter: null,

    // *** WIDGETS ***

    // apply widgets on tablesorter initialization
    initWidgets: true,

    // include zebra and any other widgets, options:
    // 'columns', 'filter', 'stickyHeaders' & 'resizable'
    // 'uitheme' is another widget, but requires loading
    // a different skin and a jQuery UI theme.
    widgets: ['zebra', 'columns'],

    widgetOptions: {

        // zebra widget: adding zebra striping, using content and
        // default styles - the ui css removes the background
        // from default even and odd class names included for this
        // demo to allow switching themes
        // [ "even", "odd" ]
        zebra: [
            "ui-widget-content even",
            "ui-state-default odd"],

        // uitheme widget: * Updated! in tablesorter v2.4 **
        // Instead of the array of icon class names, this option now
        // contains the name of the theme. Currently jQuery UI ("jui")
        // and Bootstrap ("bootstrap") themes are supported. To modify
        // the class names used, extend from the themes variable
        // look for the "$.extend($.tablesorter.themes.jui" code below
        uitheme: 'jui',

        // columns widget: change the default column class names
        // primary is the 1st column sorted, secondary is the 2nd, etc
        columns: [
            "primary",
            "secondary",
            "tertiary"],

        // columns widget: If true, the class names from the columns
        // option will also be added to the table tfoot.
        columns_tfoot: true,

        // columns widget: If true, the class names from the columns
        // option will also be added to the table thead.
        columns_thead: true,

        // filter widget: If there are child rows in the table (rows with
        // class name from "cssChildRow" option) and this option is true
        // and a match is found anywhere in the child row, then it will make
        // that row visible; default is false
        filter_childRows: false,

        // filter widget: If true, a filter will be added to the top of
        // each table column.
        filter_columnFilters: true,

        // filter widget: css class applied to the table row containing the
        // filters & the inputs within that row
        filter_cssFilter: "tablesorter-filter",

        // filter widget: Customize the filter widget by adding a select
        // dropdown with content, custom options or custom filter functions
        // see http://goo.gl/HQQLW for more details
        filter_functions: null,

        // filter widget: Set this option to true to hide the filter row
        // initially. The rows is revealed by hovering over the filter
        // row or giving any filter input/select focus.
        filter_hideFilters: false,

        // filter widget: Set this option to false to keep the searches
        // case sensitive
        filter_ignoreCase: true,

        // filter widget: jQuery selector string of an element used to
        // reset the filters.
        filter_reset: null,

        // Delay in milliseconds before the filter widget starts searching;
        // This option prevents searching for every character while typing
        // and should make searching large tables faster.
        filter_searchDelay: 300,

        // Set this option to true if filtering is performed on the server-side.
        filter_serversideFiltering: false,

        // filter widget: Set this option to true to use the filter to find
        // text from the start of the column. So typing in "a" will find
        // "albert" but not "frank", both have a's; default is false
        filter_startsWith: false,

        // filter widget: If true, ALL filter searches will only use parsed
        // data. To only use parsed data in specific columns, set this option
        // to false and add class name "filter-parsed" to the header
        filter_useParsedData: false,

        // Resizable widget: If this option is set to false, resized column
        // widths will not be saved. Previous saved values will be restored
        // on page reload
        resizable: true,

        // saveSort widget: If this option is set to false, new sorts will
        // not be saved. Any previous saved sort will be restored on page
        // reload.
        saveSort: true,

        // stickyHeaders widget: css class name applied to the sticky header
        stickyHeaders: "tablesorter-stickyHeader"

    },

    // *** CALLBACKS ***
    // function called after tablesorter has completed initialization
    initialized: function (table) {},

    // *** CSS CLASS NAMES ***
    tableClass: 'tablesorter',
    cssAsc: "tablesorter-headerSortUp",
    cssDesc: "tablesorter-headerSortDown",
    cssHeader: "tablesorter-header",
    cssHeaderRow: "tablesorter-headerRow",
    cssIcon: "tablesorter-icon",
    cssChildRow: "tablesorter-childRow",
    cssInfoBlock: "tablesorter-infoOnly",
    cssProcessing: "tablesorter-processing",

    // *** SELECTORS ***
    // jQuery selectors used to find the header cells.
    selectorHeaders: '> thead th, > thead td',

    // jQuery selector of content within selectorHeaders
    // that is clickable to trigger a sort.
    selectorSort: "th, td",

    // rows with this class name will be removed automatically
    // before updating the table cache - used by "update",
    // "addRows" and "appendCache"
    selectorRemove: "tr.remove-me",

    // *** DEBUGING ***
    // send messages to console
    debug: true

});

// Extend the themes to change any of the default class names ** NEW **
$.extend($.tablesorter.themes.jui, {
    // change default jQuery uitheme icons - find the full list of icons
    // here: http://jqueryui.com/themeroller/ (hover over them for their name)
    table: 'ui-widget ui-widget-content ui-corner-all', // table classes
    header: 'ui-widget-header ui-corner-all ui-state-default', // header classes
    icons: 'ui-icon', // icon class added to the <i> in the header
    sortNone: 'ui-icon-carat-2-n-s',
    sortAsc: 'ui-icon-carat-1-n',
    sortDesc: 'ui-icon-carat-1-s',
    active: 'ui-state-active', // applied when column is sorted
    hover: 'ui-state-hover', // hover class
    filterRow: '',
    even: 'ui-widget-content', // even row zebra striping
    odd: 'ui-state-default' // odd row zebra striping
});  

Apologies if this has been asked already, I swear I looked all over and didn't find it.

I'm trying to implement tablesorter on our internal website, and I'm working with a Codeigniter setup that I didn't create and that programmer is gone, so that might be an issue.

Jeff

Mottie commented 10 years ago

Hi @driscojs!

Hmm, all that code looks like the exact same as from the jsFiddle. Can you provide a demo of this issue? I do wonder if there is some other code on your page that is interfering.

driscojs commented 10 years ago

Happy to supply whatever I can. How would you like me to demo it to you? I can take some screenshots if that’s all you need. I’m not sure about getting access to our site, A: it’s a dev site, B: it’s locked to our logins.

I can give you the source view easily enough if that’s good enough.


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Friday, April 04, 2014 3:07 PM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

Hi @driscojshttps://github.com/driscojs!

Hmm, all that code looks like the exact same as from the jsFiddle. Can you provide a demo of this issue? I do wonder if there is some other code on your page that is interfering.

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39600178.

Mottie commented 10 years ago

Yeah, I know that makes it more difficult. I don't think screenshots would help in this case. I guess what I'm asking is can you duplicate the problem in a jsFiddle demo?

If not, then I would think that there is some other function bound to the table. So, you could start by disabling blocks of unrelated code to see if this issue resolves.

Another thing you could do is look to see what events are bound to the table cell. If you are using a newer version of jQuery, type the following into the console and you should see the result below:

// enter this into the console (check both the :first and :last th's)
jQuery._data( $('th:first')[0], 'events' );

// this should be the "standard" result
Object {keyup: Array[1], sort: Array[1], mouseup: Array[1], mousedown: Array[1], selectstart: Array[1]}
> keyup: Array[1]
> mousedown: Array[1]
> mouseup: Array[1]
> selectstart: Array[1]
> sort: Array[1]
> __proto__: Object

If you see more or less events than those shown above, then there might be other code interfering. You should be able to click on the triangle (shown as > above) in the console to expand each object for more details.

driscojs commented 10 years ago

I entered that console command and got exactly what you listed below for both first and last. We’re on 1.5.2 for jQuery it appears. As for jsFiddle, I copied that code out exactly, since I thought it might be our code as well.

I attached the view-source of our page, maybe it’ll help. ☺

driscojs commented 10 years ago

In case it matters, I just tried with jQuery 1.11 as well, similar results.


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Friday, April 04, 2014 4:11 PM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

Yeah, I know that makes it more difficult. I don't think screenshots would help in this case. I guess what I'm asking is can you duplicate the problem in a jsFiddle demohttp://jsfiddle.net/Mottie/abkNM/?

If not, then I would think that there is some other function bound to the table. So, you could start by disabling blocks of unrelated code to see if this issue resolves.

Another thing you could do is look to see what events are bound to the table. If using a newer version of jQuery, type the following into the console and you should see the result below:

// enter this into the console (check both the :first and :last th's)

jQuery._data( $('th:first')[0], 'events' );

// this should be the "standard" result

Object {keyup: Array[1], sort: Array[1], mouseup: Array[1], mousedown: Array[1], selectstart: Array[1]}

keyup: Array[1]

mousedown: Array[1]

mouseup: Array[1]

selectstart: Array[1]

sort: Array[1]

proto: Object

If you see more or less events than those shown above, then there might be other code interfering. You should be able to click on the triangle (shown as > above) in the console to expand each object for more details.

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39606288.

Mottie commented 10 years ago

Hmm, one more thing to try... Enter the following into your console:

$('table').trigger('sorton', [[[0,0]]]);

And see if the first column sorts. If it does, I'm not sure what else to tell you beside time to dig through the other code on the page.

driscojs commented 10 years ago

Rob,

When I paste that code into the console, it sorts like one would expect. When I change the first digit to 2,0 or 1,0, the corresponding columns sort just fine. Any clue what’s going on?


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Friday, April 04, 2014 7:36 PM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

Hmm, one more thing to try... Enter the following into your console:

$('table').trigger('sorton', [[[0,0]]]);

And see if the first column sorts. If it does, I'm not sure what else to tell you beside time to dig through the other code on the page.

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39621519.

Mottie commented 10 years ago

Well it sounds like tablesorter is set up properly.

The only thing I can think of is that there might be some header cell element being repositioned using css or javascript, or maybe there is content being added using a :before or :after css definition that is covering up header cells. To troubleshoot this, try right-clicking on any of the header cells and "Inspect element" (in Chrome). When you hover over the elements in the development window, it highlights that element on the web page so you can tell if there is any overlapping going on. You can even click on the :after pseudo element in Chrome and see it on the web page.

If that isn't the issue, then I don't think I can be of more help unless I saw the page itself. Maybe you can set me up with a temporary user account - I only need to see it, so I don't need any admin privileges.

driscojs commented 10 years ago

Rob,

You can reach the page I’m testing on at http://dashdev.search-mojo.com/tablesorterTest

It’s a basic Codeigniter controller with only one function, the index, and that only loads the view. All js, html, css is in the view. We do have a custom base controller, but I’m just extending the CI_Controller directly for this page. I appreciate all the help!


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Monday, April 07, 2014 12:11 PM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

Well it sounds like tablesorter is set up properly.

The only thing I can think of is that there might be some header cell element being repositioned using css or javascript, or maybe there is content being added using a :before or :after css definition that is covering up header cells. To troubleshoot this, try right-clicking on any of the header cells and "Inspect element" (in Chrome). When you hover over the elements in the development window, it highlights that element on the web page so you can tell if there is any overlapping going on. You can even click on the :after pseudo element in Chrome and see it on the web page.

If that isn't the issue, then I don't think I can be of more help unless I saw the page itself. Maybe you can set me up with a temporary user account - I only need to see it, so I don't need any admin privileges.

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39750009.

Mottie commented 10 years ago

Ok, that is very odd.

I did replace the version of tablesorter that was there (v2.15.11) with the latest (v2.15.13) and everything started working - there was an issue with v2.15.11 where the cell indexing was undefined (see #554) and causing problems.

Also, the pager plugin isn't being used on that demo page, but it appears to be the same pager plugin provided with v2.0.5b on tablesorter.com. Please update this version if you plan to use the pager. And I wouldn't recommend using the metadata plugin unless you plan to use it. Everything in tablesorter can now be done using data-attributes.

driscojs commented 10 years ago

Rob,

Excellent! I’ll give it a try this morning.

The pager is probably left in when I copied and pasted, just a silly oversight. The meta, I think I didn’t understand how to use it. Thanks for educating me! Also, thanks for all the patience and troubleshooting!


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Monday, April 07, 2014 6:39 PM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

Ok, that is very odd.

I did replace the version of tablesorter that was there (v2.15.11) with the latest (v2.15.13) and everything started working - there was an issue with v2.15.11 where the cell indexing was undefined (see #554https://github.com/Mottie/tablesorter/pull/554#issuecomment-39078308) and causing problems.

Also, the pager plugin isn't being used on that demo page, but it appears to be the same pager plugin provided with v2.0.5b on tablesorter.com. Please update this version if you plan to use the pager. And I wouldn't recommend using the metadata plugin unless you plan to use it. Everything in tablesorter can now be done using data-attributes.

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39792509.

Mottie commented 10 years ago

The metadata plugin allows you to set headers options as a header class name.

So instead of using this method:

headers: {
  0: { sorter: false }
}

You can use the metadata plugin like this:

<th class="{ sorter: false }"></th>

The above were the only two options available in the original tablesorter. In this forked version, you can add a class name

<th class="sorter-false"></th>

or use a data-attribute:

<th data-sorter="false"></th>

The priority of these setting is data-attribute, metadata, header option then class name (see this demo for more details)

driscojs commented 10 years ago

I’m glad to report all is well now. Just have to figure out how to hide a disabled filter on one column! Everything is sorting like it should!


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Tuesday, April 08, 2014 10:28 AM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

The metadata plugin allows you to set headers optionshttp://mottie.github.io/tablesorter/docs/#headers as a header class name.

So instead of using this method:

headers: {

0: { sorter: false }

}

You can use the metadata plugin like this:

The above were the only two options available in the original tablesorter. In this forked version, you can add a class name

or use a data-attribute:

The priority of these setting is data-attribute, metadata, header option then class name (see this demohttp://mottie.github.io/tablesorter/docs/example-parsers-class-name.html for more details)

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39854259.

Mottie commented 10 years ago

Good to hear! To hide a disabled filter, use this css:

.tablesorter-filter.disabled {
    display: none;
}
driscojs commented 10 years ago

Already did. :) It worked nicely and we’ve rolled it out to users.


[cid:image001.jpg@01CF1296.7E1F7960]

Jeff Driscoll | IT Manager Office: 800-939-5938 x104 | Mobile: 540-271-6709 jdriscoll@marketing-mojo.commailto:jdriscoll@marketing-mojo.com

From: Rob G [mailto:notifications@github.com] Sent: Tuesday, April 08, 2014 4:52 PM To: Mottie/tablesorter Cc: Jeff Driscoll Subject: Re: [tablesorter] Always sorts using the last column (#569)

Try:

.tablesorter-filter.disabled {

display: none;

}

— Reply to this email directly or view it on GitHubhttps://github.com/Mottie/tablesorter/issues/569#issuecomment-39900297.

Mottie commented 10 years ago

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue this discussion.