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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:43:14+00:00 2026-06-13T02:43:14+00:00

I have been a huge fan of http://www.kryogenix.org/code/browser/sorttable/ sort table javascript code. It works

  • 0

I have been a huge fan of http://www.kryogenix.org/code/browser/sorttable/ sort table javascript code. It works on so many levels.

That said, I recently come face to face with an issue trying to get the sorts to work when called via ajax. What I have is a div layer on my main page, and I am calling a dynamic query with ajax to dynamically populate the page. I was thinking that those results could then be sortable using the above javascript file. However, that is not the case and I don’t quit understand why it will not work.

I have verified the code works on the page by placing the same query on the page and populating it when the page loads normally and the sorttable.js works like a charm.

If anybody could tell me why a client side language like javascript wouldn’t work when called via ajax, I would appreciate it. I’m sure it is suppose to but I more then likely goofed something up.

For reference this is my jquery / ajax

        <script type="text/javascript">
                $(document).ready(function(){
                $(".small_radio").click(function() {

                //check radio buildings for selected value
                var radBuild = $('input:radio[name=buildings]:checked').val();

                //check radio daterange for selected value
                var radDate = $('input:radio[name=daterange]:checked').val();

                //create array for multiple possibilites from checkbox users
                var chkUsers = [];
                //loop through checkboxes appending values to array
                $('#checkall :checked').each(function() {
                   chkUsers.push($(this).val());
                 });

                 //send the request
                $.ajax({
                    url: "/inventory/pick-print-results.php",
                    type: "post",
                    data: "buildings=" + radBuild + "&daterange=" + radDate + "&users[]=" + chkUsers,
                    // callback for success
                     success: function(data, textStatus) {
                         $(".loadonly").hide();
                         $(".ajax_stuff").html(data);  //no data here
                          //alert(data); //Data here
                      }, //end success else...
                      //if failsauce throw error
                      error: function() {
                          alert('Not OKay');
                         } //end error failsauce
                      }); //ends .ajax function
                   }); //end #checkall. click function
                }); // ends ready function
            </script>

This is my php query data that is called via ajax..

<?php $message.='
            <input type="hidden" value="'.$big_chunk_sql.'" id="displayed_sql" name="displayed_sql">
            <input type="hidden" value="'.$row_count.'" id="amount" name="amount">
             <input type="hidden" value="print" id="print" name="print">
            <table border="0" width="100%" class="sortable">
            <th class="admin">Location</th>
            <th class="admin">Pick For</th>
            <th class="admin">Requested Date</th>
            <th class="admin">Part Number</th>
            <th class="admin">Quantity</th>
            <th class="admin">Received Date</th>
            <th class="admin">Action</th>';
            while($data=mysql_fetch_array($big_chunk_query)) {

                //Deal with operator Name Don Ford = D Ford
                list($user_first,$user_last)=explode(' ',$data['description']);
                $user_first=strtoupper(substr($user_first,0,1));
                $user_last=ucfirst($user_last);
                $operator_name=$user_first.' ' . $user_last;

               if ($i%2 !=0)
                 $rowColor = 'tr2center';
                  else
                 $rowColor = 'tr1center';
                    $pendingdate= trim($data['received_date']);
                    $newpendingdate = date('m-d-Y',strtotime($pendingdate));
                    $message.= '<tr class="'.$rowColor.'">
                    <td>'. $data['location'].'</td>
                    <td>'.$operator_name.'</td>
                    <td>'.date("m-j-y, g:i a", strtotime($data['date_requested'])) .'</td>
                    <td>'.$data['part_number'] . '</td>
                    <td>'. $data['qty_requested'] . '</td>
                    <td>'. $newpendingdate . '</td><td> 
                    <a href="picking.php?radiopart='.urlencode($data['org_transaction_id']) .'">Mark Picked</a></td></tr>';
                    if($data['notes_to_picker']!='') { 
                    $message.= '<tr class="'.$rowColor.'" align="center"><td colspan="2">&nbsp;</td><td align="right"><b>notes:</b></td><td colspan="4">' . $data['notes_to_picker'].'</td></tr>';
                    }
                    $i++;
                }
                $message.= '</table>';
                echo $message;
    ?>
  • 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-13T02:43:15+00:00Added an answer on June 13, 2026 at 2:43 am

    Your case is what the plugin author would consider “advanced” if you read the documentation at the link you provided. http://www.kryogenix.org/code/browser/sorttable/#ajaxtables

    in your success callback, you need sorttable.makeSortable($("#tableid")[0]);

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

Sidebar

Related Questions

I have been using the DataTables plugin for jQuery (http://www.datatables.net) to search, sort and
I have been reading about tag aware sharding..These are the links I referred: http://www.mongodb.org/display/DOCS/Tag+Aware+Sharding
As a huge fan of C++, there have been a question in my mind.
I have been a huge fan of Jquery validate since it came out but
I have been working on a huge ETL project with 150+ tables and during
I've never been a huge Python fan. I learned it for a course where
I have been working on a huge project for work for a while now,
I've got several reports and they have been built with various formatting. Nothing huge
I am working on a huge project. I have been working on it for
We have been using temporary table to store intermediate results in pl/sql Stored procedure.

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.