Welcome Guest, Not a member yet? Register   Sign In
What's wrong with my pagination?
#6

[eluser]Chillahan[/eluser]
Whoa - where is CI automatically generating the offset? I echo'ed its config value for per_page before and after ->initialize, no change. (and why would there be? per_page is pretty static.)

This is how I calculate my offset -

if ($this->uri->segment(3))
{
$itemStartIndex = (($this->uri->segment(3) - 1) * $itemsPerPage);
}
else
{
$itemStartIndex = '0';
}

Note that I test segment(3) for existence since if it doesn't exist, it means we're at page 1, so offset should be zero (not 1).

Anyway, I am still having a problem - class pagination will generate a link that says page 3, for example, but when I click it it goes to page 4, which doesn't exist. I am starting to think there is a bug in class pagination for very small page sizes (i.e., two items per page). Anyone else notice this?


Messages In This Thread
What's wrong with my pagination? - by El Forum - 07-03-2008, 03:20 PM
What's wrong with my pagination? - by El Forum - 07-03-2008, 05:44 PM
What's wrong with my pagination? - by El Forum - 07-03-2008, 05:51 PM
What's wrong with my pagination? - by El Forum - 07-03-2008, 06:29 PM
What's wrong with my pagination? - by El Forum - 07-03-2008, 06:53 PM
What's wrong with my pagination? - by El Forum - 07-09-2008, 08:39 PM
What's wrong with my pagination? - by El Forum - 07-09-2008, 08:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB