Welcome Guest, Not a member yet? Register   Sign In
paginations links
#1

[eluser]edhrx[/eluser]
Hi,
I am having a problem with paginations links. It only ever displays 1,2,3 >last even though there are loads more pages. The clicks on 1,2 or 3 all work as expected but there is no displaying of 4,5,6 etc

Best wishes Ed.
#2

[eluser]Merolen[/eluser]
Code:
$config['total_rows'] = 30;

My first guess would be that the total_rows isn't getting the right number. Have you checked that?

Have you gone through the pagination documentation?
#3

[eluser]Seppo[/eluser]
My first guess is $config['num_links'] = 2;
Quote:The number of "digit" links you would like before and after the selected page number. For example, the number 2 will place two digits on either side, as in the example links at the very top of this page.
http://ellislab.com/codeigniter/user-gui...ation.html
#4

[eluser]edhrx[/eluser]
Seppo,
many thanks , you were right the ['num_links'] was not set. However, the issue is still not fully resolved. I use pagination in one or two of the sites no problem...however, if you say click on on link '16' then next return from the server should give something like
15, 16, 17 18 last etc. it remains on 16

thanks ed
#5

[eluser]Merolen[/eluser]
Both num_links and per_page has a default value if you don't specify it, so can't understand why that should have anything to do with it.
Code:
$config[’num_links’] = 2;
$config[’per_page’] = 10

This is my pagination helperfuntion which works fine

Code:
function pagination($url, $numRows) {
    $CI =& get_instance();
    
    $CI->load->library('pagination');
    
    $config['base_url'] = site_url().'/'.$url;
    $config['total_rows'] = $numRows;
    $config['per_page'] = 15;
    $config['first_link'] = '';
    $config['last_link'] = '';
    $config['num_links'] = 5;
    $CI->pagination->initialize($config);
    $pagStr = $CI->pagination->create_links();
    
    return $pagStr;
}




Theme © iAndrew 2016 - Forum software by © MyBB