Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:03:28+00:00 2026-05-26T09:03:28+00:00

the jQuery tablesorter plugin isn’t working too well for one specific case. Basically, I

  • 0

the jQuery tablesorter plugin isn’t working too well for one specific case. Basically, I just want this to sort between the text “None” and ‘ANYTHING ELSE’ … but I can’t figure out how to do it (or even where to begin, really…).

Column #3 is filled with a lot of different possibilities, but what I want to do is simple:

  1. When the cell contains the text, “None”
  2. When the cell contains ANYTHING ELSE AT ALL….

Thanks ahead of time.

Right now, the call looks like this:

$(document).ready( function () {
            // TableSorter
                $("#dt-results") 
                .tablesorter({
                                widgets: ['zebra'], 
                                sortList: [[0,1]],
                                headers: { 
                                    1: { 
                                        sorter:'currency' 
                                    }
                                }, 

                                textExtraction: function(node) {
                                    return $(node).text();
                                }

                })
                .tablesorterPager({container: $("#pager")})
                .tablesorterFilter({filterContainer: $("#filter-box"),
                              filterClearContainer: $("#filter-clear-button"),
                              filterCaseSensitive: false,
                              filterWaitTime: 10});
        });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:03:29+00:00Added an answer on May 26, 2026 at 9:03 am

    look at the updated code: http://jsfiddle.net/L4PFn/9/

    you can certainly make the code more cleaner.
    but for now the logic is.. textExtraction: function(node) gives you the html/content of the column and you need to return text which will be used in sorting.

    So 1st step is how to identify that currently textextraction is at User Column. For this you can use a unique class attribute on the content of user column.
    in my example I have added usercol as that class

    <div class="outer usercol">
      <div class="inner">
         <div style="line-height:12px; margin-bottom:10px;">Bobb Johnson<br>&nbsp;&nbsp;&nbsp;<em>STATUS</em><br>
         </div>
      </div>
    </div>
    

    and

    <div class="outer usercol">None</div>
    

    and in textExtraction add

    if($(node.innerHTML).hasClass('outer') && $(node.innerHTML).hasClass('usercol') ){
    }
    

    this if statement tells us that we are at our user column

    next step is to check if content of current column is ‘None’. if ‘None’ then return ‘z’ or ‘a’, as this will ensure that ‘none’ will either be at top or bottom, when sorted

    if($.trim($(node).text()) == 'None'){
      return 'z'; //so that none comes last
    }
    

    otherwise you can either return $(node).text(); or better is to drill down to name.
    you can add name in a span, give it a unique class name and then return $(node.innerHTML).find('span.unique-class-name').text()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this great Tablesorter plugin for jQuery but I can't make it work
I want to use Christian Bach's tableSorter client-side table sorting jQuery plugin with my
I am using a Jquery Tablesorter plugin for sorting a table.I want, when I
I'm currently playing around with the Tablesorter jQuery plugin in one of the sites
I am using the jQuery tablesorter plugin . It seems to be working fine
I am using the TableSorter plugin in jquery. However one of the column in
I want to use the tablesorter plugin: http://tablesorter.com/docs/ with the thead plugin: http://www.asual.com/jquery/thead/ It
I am using a jquery tablesorter plugin( http://tablesorter.com/docs/ ) for sorting my tables. This
i wanna sort my table with jQuery Plugin TableSorter . So i get this
I am using the jQuery tableSorter plugin on a page. Unfortunatley, the table that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.