Welcome Guest, Not a member yet? Register   Sign In
Pagination Problem: Click on pagination link greater than $page['num_links'] and all goes wrong
#1

[eluser]tinawina[/eluser]
Pagination has worked great for me for quite some time. However, I now have a web site that draws from 1000+ records and am experiencing an issue.

In the initial pagination display, with $page['num_links'] = '20', all looks fine:

Quote: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 » Last ›

What's happening is when I click on a pagination page link, the link display gets bigger and bigger. So if i click on "2", the list of links grows to include "22". If I click on "15" links grow to include "35". At some point, like if I click on "20", the list of links grows too long, breaks out of the design, wraps to a second line at some point and the display is a disaster:

Quote:
First « 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 » Last

What is going on here? Any help is much appreciated! Here's what my pagination set-up looks like:

Code:
$page['base_url'] = $CI->config->item('base_url') . $service;
$page['total_rows'] = $num_rows; // Get row count
$page['per_page'] = $offset;
$page['num_links'] = '20';
$page['uri_segment'] = '2';
$page['full_tag_open'] = '<p>'; // The opening tag placed on the left side of the entire result.
$page['full_tag_close'] = '</p>'; // The closing tag placed on the right side of the entire result.
$page['next_link'] = '&raquo;'; // The text you would like shown in the "next" page link.
$page['prev_link'] = '&laquo;'; // The text you would like shown in the "previous" page link.
$page['cur_tag_open'] = '&nbsp;<strong>'; // The opening tag for the "current" link.
$page['cur_tag_close'] = '</strong>'; // The closing tag for the "current" link.

Thanks!
#2

[eluser]pickupman[/eluser]
What is setting your $offset variable? Usually this is a fixed number, and the fact that you have this type of problem might be consistent if you are getting this from the URI. If you have drop down for a setting like Display 10 Results / 20 Results ...etc per page, then that may not be the issue.

What if you set this to a fixed number?




Theme © iAndrew 2016 - Forum software by © MyBB