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 788767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:25:11+00:00 2026-05-14T21:25:11+00:00

i see that in tableSorter you can sort one page at a time which

  • 0

i see that in tableSorter you can sort one page at a time which concerns me.

Only 1 page of results can be sorted at a time?, which is pretty limiting. If you have a query result that spans multiple pages, how you will handle this?

If anyone knows better, feel free to correct me if iam incorrect

Thanks.

  • 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-14T21:25:11+00:00Added an answer on May 14, 2026 at 9:25 pm

    I would assign an ID to the th in thead for the table which correspond to you columns in the SQL-table.

    $("table thead th").click(function(){
        $.getJSON('ajax/get_results.php', 
            {sortby: $(this).attr('id')},
            function(data) {
                $.each(data, function(){
                    // fill table here
                }
            });   
    });
    

    You could create some function for sorting the table that you also could use for changing page with AJAX if you are not already doing it.

    And on the backend then sort with SQL

    "SELECT * FROM table ORDER BY ".$_GET['sortby']
    

    Of course you should secure that sortby, for example filter it with an array of allowed values. I would suggest creating an array with allowed column sort names and using the array_intersect() function to only filter out the allowed values or just check with

    if(isset($allowed_columns[$_GET['sortby']]))
    

    Then just output it all in JSON by putting all the results in an array and then:

    echo json_encode($array_with_results);
    

    I guess you would like to output somthing like this in JSON:

    {
      {col1: 'row1',col2: 'row1',col3: 'row1'},
      {col1: 'row2',col2: 'row2',col3: 'row2'},
      {col1: 'row3',col2: 'row3',col3: 'row3'}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see that EF can update a model based on an existing database schema.
I see that you can enable/disable using the EnableWindow method, but how do I
From an MSDN article on the subject, we can see that we create a
You can see the way its suppose to work by visiting: link text That
I see that I can Delete a record that doesn't exist with impunity; but
I see that there are two options that I know can be used in
I see that the SML/NJ includes a queue structure. I can't figure out how
I see that advantages or running programs simultaeously are that the user can run
I see that I can create the the UI controls like buttons, labels and
I see that I can start processes with System.Diagnostics.Process. I'm trying with the following

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.