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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:46:35+00:00 2026-05-30T19:46:35+00:00

When I try to sort rows on below table after clicking the append button

  • 0

When I try to sort rows on below table after clicking the append button why is the added data removed from the table ?

Here is the running code – http://jsfiddle.net/fXAbh/
Click append and then try to sort a row by clicking on the column header, the added row disappears, I need the just added data to also be sortable and not be removed.

<!DOCTYPE html>
<html>
<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
 <script src="http://tablesorter.com/__jquery.tablesorter.js" type="text/javascript"></script>
 <script src="http://tablesorter.com/addons/pager/jquery.tablesorter.pager.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://tablesorter.com/themes/blue/style.css" type="text/css" media="print, projection, screen" />

  <script type="text/javascript">
    $(document).ready(function() {
                { 
                    $("#myTable").tablesorter({widthFixed: true, widgets: ['zebra']}).tablesorterPager({container: $("#pager")}); 
                    $("#pager").css('top','auto');  
               } 
    });

    function append() {
         $('#myTable > tbody:last').prepend('<tr><td>test</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>');
        };

   </script>

</head>


<body>
<input type="button" value="Append" onclick="append();" />
<table id="myTable" cellspacing="1" class="tablesorter">
    <thead>
        <tr>
            <th>Name</th>
            <th>Major</th>
            <th>Sex</th>
            <th>English</th>
            <th>Japanese</th>
            <th>Calculus</th>
            <th>Geometry</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Student01</td>
            <td>Languages</td>
            <td>male</td>
            <td>80</td>
            <td>70</td>
            <td>75</td>
            <td>80</td>
        </tr>
        <tr>
            <td>AStudent01</td>
            <td>Languages</td>
            <td>male</td>
            <td>80</td>
            <td>70</td>
            <td>75</td>
            <td>80</td>
        </tr>
</tbody>
</table>

<div id="pager" class="pager">
    <form>
        <input type="text" class="pagedisplay"/>
        <select class="pagesize">
            <option selected="selected"  value="10">10</option>
            <option value="20">20</option>
            <option value="30">30</option>
            <option  value="40">40</option>
        </select>
    </form>
</div>



</body>
</html>
  • 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-30T19:46:36+00:00Added an answer on May 30, 2026 at 7:46 pm

    After appending a new row you should trigger the update event on the table. So that plugin knows that it has to update its data which is used to rebind the table on sort.

    $("#myTable").trigger("update"); 
    

    Working demo – http://jsfiddle.net/ShankarSangoli/fXAbh/2/

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

Sidebar

Related Questions

I try to sort the data in Excel 2010 The blank character always comes
I have a table of data that contains about 260 rows. Each of these
I have a table with various rows that display data, in each row I
In a sort of try/catch form I want to execute a bash that doesn't
I've see this sort of thing in Java code quite often... try { fileStream.close();
I have a datagrid that I want the user to sort the rows on.
I need some sort of an algorithm, that would try to find free space
-- Pivot table with one row and four columns SELECT 'Values' tValues, ID,Name,ValueID,Value FROM
I have a data set whose elements are displayed as rows in a DataGrid.
I want to sort below xml, Based on the Adult and child ( i

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.