[eluser]internut[/eluser]
My CI project is going well and I'm getting closer to having a section which uses pagination done. So I added in over 1,000 test records to see how things went and pagination broke.
The records displaying to screen and all are correct and perfect, but the links that pagination library is sending out gets all messed up.
I Have:
Code:
$this->load->library('pagination');
$config['base_url'] = site_url() . "/admin/users/page/";
$config['total_rows'] = $data[user_count];
$config['per_page'] = $this->config->item('per_page');
$config['uri_segment'] = 4;
$config['num_links'] = 8;
$this->pagination->initialize($config);
There are 1093 records set in $data[user_count]
First Page of pagination gives links:
1 2 3 4 5 6 7 8 9 > Last ›
Which almost looks ok. Thought there should be 8 links?
Anyway I click on link #8
< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 > Last ›
I click on #16 and get:
‹ First < 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 > Last ›
Click on Last & get:
‹ First < 102 103 104 105 106 107 108 109 110
Which almost looks right (tho 9 links instead of 8)
Click on #102 & get:
‹ First < 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 >
Any thoughts? This did not seem to be a problem while testing with 20 to 30 records.
Maybe I'll go go 999 and see if thats where it gets crazy.