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

  • Home
  • SEARCH
  • 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 7885923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:11:34+00:00 2026-06-03T05:11:34+00:00

I am hopeful that somebody can help me alter this JQuery Code so that

  • 0

I am hopeful that somebody can help me alter this JQuery Code so that it will sort elements by calling by ‘table id’ rather than ‘table’. The issue is that my pages contain multiple tables and I would like the table sort to function based on one particular table identified by an ID. This functions using the Jquery Sort Elements plugin. Any Ideas?

https://raw.github.com/padolsey/jQuery-Plugins/master/sortElements/jquery.sortElements.js

$(window).load(function(){
    var table = $('table');

    $('#facility_header, #city_header')
        .wrapInner('<span title="sort this column"/>')
        .each(function(){

            var th = $(this),
                thIndex = th.index(),
                inverse = false;

            th.click(function(){

                table.find('td').filter(function(){

                    return $(this).index() === thIndex;

                }).sortElements(function(a, b){

                    return $.text([a]) > $.text([b]) ?
                        inverse ? -1 : 1
                        : inverse ? 1 : -1;

                }, function(){

                    // parentNode is the element we want to move
                    return this.parentNode; 

                });

                inverse = !inverse;

            });

        });

});//]]>  
  • 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-06-03T05:11:35+00:00Added an answer on June 3, 2026 at 5:11 am

    just change this part

    var table = $('#tableid');
    

    here is more about jquery selectors http://api.jquery.com/category/selectors/

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

Sidebar

Related Questions

This is a complicated situation (for me) that I'm hopeful someone on here can
I am hopeful that someone can look at my code and let me know
I'm hopeful that someone could potentially post an example of using FParsec where the
i see there is arrange tables that organizes your table relationships to be clear.
I've created this simple and pointless assembly (Y86) code to see if I understand
I have some code that needs to rescue multiple types of exceptions in ruby:
We have some InfoPath (XSN) forms with code-behind hosted in MOSS that have data
I need a linq expression that will find the nearest numbers (both greater or
FURTHER EDIT: Given that individuals can only access the questionnaire from a seperate website,
Good afternoon, all. I'm not too hopeful for a yes here, but if anyone

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.