Welcome Guest, Not a member yet? Register   Sign In
Strange Pagination Problem - Links
#1

[eluser]Kemik[/eluser]
Hello,

I've done a quick search but cannot find anything on this.

Basically, the pagination operates fine except the links it creates doesn't update.

Code:
// Load pagination class
        $this->load->library('pagination');
        $config['base_url'] = site_url().'/admin/users/index/';
        $config['total_rows'] = $this->db->count_all('users');
        $config['per_page'] = '10';
        
        $this->pagination->initialize($config);
        // Get results
        $data['query'] = $this->user_model->get_users($config['per_page'],$this->uri->segment(4,0));

$data['pagination'] = $this->pagination->create_links();

I echo the $pagination variable.

The code is stored in admin/users/index so the url for the pagination page 3 is admin/users/index/20 (those are the links the system creates).

It loads the correct data but doesn't update the links at the bottom. 1 is still in bold with 2 and 3 after it. As if it's still selected 1. I thing uri_segment has something to do with it but setting that to 5 still doesn't make a difference.

Thanks for the help.
#2

[eluser]Seppo[/eluser]
You should set $config['uri_segment'] = 4; to specify the offset you are using to paginate
#3

[eluser]Kemik[/eluser]
Thank you. That fixed it
#4

[eluser]extra_rice[/eluser]
[quote author="Seppo" date="1207456782"]You should set $config['uri_segment'] = 4; to specify the offset you are using to paginate[/quote]

at last this solved my problem... thanks Seppo!
#5

[eluser]Alejus[/eluser]
Excellent post, thanks.

Alejo




Theme © iAndrew 2016 - Forum software by © MyBB