Welcome Guest, Not a member yet? Register   Sign In
Little problem with pagination class
#1

[eluser]Rushino[/eluser]
Hello,

I have theses settings for the pagination.

Code:
// Récupération des groupes utilisateur
$rows = $this->usergroup->getAllInRange($id * $this->groupes_par_page - $this->groupes_par_page, $id * $this->groupes_par_page);

// Initialisation de la pagination
$this->load->library('pagination');
$config['base_url'] = base_url() . 'admin/usergroups';
$config['total_rows'] = count($this->usergroup->getAll());
$config['per_page'] = $this->groupes_par_page;
$config['full_tag_open'] = '<div class="paging">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);

The value of $this->groupes_par_page is 5.

Why does the pagination generate theses links :

first link called 1 : http://localhost/cigestion/admin/usergroups/1
second link called 2 : http://localhost/cigestion/admin/usergroups/5

Why 5 ? it should be 2. Is there anything i am doing wrong ?

Thanks!
#2

[eluser]InsiteFX[/eluser]
Because yu have not set the config item to tell it what uri_segment to use $config['uri_segment'] = 3;

InsiteFX
#3

[eluser]Rushino[/eluser]
Umm well i tried this already but still doesnt generate a correct page link it seem to take the per-pages as number displayed in link
#4

[eluser]InsiteFX[/eluser]
Are you using limit and offset when retriving you pagination data?

InsiteFX
#5

[eluser]eshaa83[/eluser]
yes its a problem but i will search on it...
#6

[eluser]Rushino[/eluser]
[quote author="InsiteFX" date="1306749587"]Are you using limit and offset when retriving you pagination data?

InsiteFX[/quote]

Yes i do.

Ive looked into the pagination class and it seem the link is rendered using cur page * per page which is a bit wierd. Personnally ive never seen something like that in a pagination mechanism.




Theme © iAndrew 2016 - Forum software by © MyBB