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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:19:38+00:00 2026-06-13T04:19:38+00:00

I have a ajax call in drupal which generates and brings back a entire

  • 0

I have a ajax call in drupal which generates and brings back a entire table right under where I click. The tables are large, so I want them paginated. I don’t have time for server side pagination and I also need to apply it in a lot of places.

I found this http://code.google.com/p/one-simple-table-paging/ a very easy to use one and should solve my purpose.

I managed to use it in static html pages:

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="oneSimpleTablePaging-1.0.js"></script>

<table class="tableToPaginate">
    <tr>
        <th>Id</th><th>Name</th>
    </tr>
        <?php for ($i = 0; $i < 100; $i++) { ?>                            
        <tr>
            <td><?php echo $i ?></td><td><?php echo "name" . $i ?></td>
        </tr>                        
        <?php } ?>
</table>

<script>
   $(document).ready(function(){
       $('.tableToPaginate').oneSimpleTablePagination({rowsPerPage: 20});
   });        
</script>

but when I use the same technique for my ajax generated tables giving them the same class and calling the script in page.tpl, php I don’t see the pagination

echo '<table id="ajaxcustomerdata" class="account_info tableToPaginate">';
.....

I am new with ajax and js; please help me out.

  • 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-13T04:19:39+00:00Added an answer on June 13, 2026 at 4:19 am

    Use DataTables javascript plugin for this purpose — very powerfull and simple jQuery plugin.

    Adding pagginated AJAX table is just a:

    $(document).ready(function() {
        $('#example').dataTable( {
            "bProcessing": true,
            "sAjaxSource": '../ajax/sources/arrays.txt'
        } );
    } );
    

    Or you can turn usual html table to DataTable table:

    $(document).ready(function() {
        $('#example').dataTable();
    } );
    

    More info on this example.

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

Sidebar

Related Questions

I have a jQuery ajax call that returns html of a table. Now I
I have an ajax call that refreshes the following table. Can I have the
I have an AJAX call, which is doing this call every 5 seconds and
I have a Ajax call using asp.net scriptmanager. Which behind the scene takes the
I have an ajax call in jquery which returns 4 different arrays. 3 of
I have 3 ajax call in one function and checkAjaxCompletion which checks each ajax
Have an ajax call to updateUser which does this: puts session[:user_id] user = User.find(params[:user_id])
I have 2 ajax call in 2 difference functions. I want to use .click
I have an ajax call to fetch information from Flickr API which returns JSON
I have an ajax call that come back from a request to the server

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.