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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:46:18+00:00 2026-06-07T08:46:18+00:00

In the jQuery plugin, jPaginate, the number of child objects is always returning the

  • 0

In the jQuery plugin, jPaginate, the number of child objects is always returning the value of 1 determined by this code (lines 45-48 in jPaginate.js):

//getting the amount of elements inside parent element
var number_of_items = obj.children().size();
//calculate the number of pages we are going to have
var number_of_pages = Math.ceil(number_of_items/show_per_page);

I call the script in the header in the document.ready function:

$("#content").jPaginate({
items: 4,
pagination_class: "pagination",
minimize: true                    
});

and I wrapped a div with id=”content” around the table rows I want paginated like this:

    <div id="content">
        <table class="stripeMe center box-shadow-inner">
            <?php foreach ($invoices as $invoice) { ?>
                <tr>
                    <td>
                        <a href='<?php echo $_SERVER['PHP_SELF']; ?>/retrieve?class=InvoiceLineItems&amp;id=<?php echo $invoice['invoice_id']; ?>'><?php echo $invoice['invoice_number']; ?></a>&nbsp;<?php echo $invoice['customer_name'] ?>&nbsp;<?php echo $invoice['invoice_date'] ?> 
                    </td>
                </tr>   
            <?php } ?>    
        </table>
    </div>

What I get is one long page of records, with the pagination selector set to ‘previous’ 1 ‘next’. I tripled check, removed & replaced, and debugged the code as best I could. I still cannot determine why number_of_items gets set to 1.

Any help is appreciated.
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-06-07T08:46:20+00:00Added an answer on June 7, 2026 at 8:46 am

    The answer is due to the selector.

    var number_of_items = obj.children().size();
    

    The obj is #content which your are passing to the plugin. So obj.children() is only returning the first child, table, within the obj. Since there is only one item in the array it has a size of 1.

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

Sidebar

Related Questions

the jquery plugin that im using is this http://code.google.com/p/jquery-in-place-editor/ if i have a table
Im using this jquery plugin for searching text : http://code.google.com/p/jquery-highlight/downloads/list .. But im not
I'm using this jquery plugin to build forms. In order to allow the modification
I'm using Supersized jQuery plugin. My images are 1600x672 , but it always resize
I am using the jquery datatable plugin. I have the following code that sets
This jQuery plugin doesn't work with the y-axis. http://jsfiddle.net/weissraum/tsyzZ/ How can this be solved?
I am using this jQuery plugin in my app http://www.building58.com/examples/tabSlideOut.html It all works well
This jquery plugin allows you to turn any element into a file input element.
I'm using a jQuery plugin called Colorbox (http://colorpowered.com/colorbox/) and loading content via Ajax. This
I'm using Supersized jQuery plugin . This plugin is used to make full screen

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.