Welcome Guest, Not a member yet? Register   Sign In
two paginations on one controller
#2

[eluser]falloutphil[/eluser]
Hi,

I reckon this is because you're stilling sending the same URI segment to both paginators, even if you are handling what data is returned by your db query, CI's paginator still renders the links associated to BOTH objects using the same single peice of information.

Looking at the paginator code I've pointed out this below. I've had a quick go at getting around the problem by modifying the URI segment the paginate works with depending upon another URI segment - i.e. have a uri segment that is permanently set to 0 and switch to this in your config if you want to view the other paginator.

Frankly it's can of worms, and I didn't get it working very well. I'd suggest using create_links as a base, and rewriting it to handle your case.

If you do get it working nicely - I'd be interested to know however!

Hope this helps,

Phil.

// Determine the current page number.
$CI =& get_instance();
if ($CI->uri->segment($this->uri_segment) != 0) <---- GOES WRONG HERE.
{
$this->cur_page = $CI->uri->segment($this->uri_segment);

// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}


Messages In This Thread
two paginations on one controller - by El Forum - 03-01-2008, 02:16 PM
two paginations on one controller - by El Forum - 03-02-2008, 03:13 PM
two paginations on one controller - by El Forum - 03-02-2008, 04:47 PM
two paginations on one controller - by El Forum - 03-02-2008, 05:32 PM
two paginations on one controller - by El Forum - 03-02-2008, 06:13 PM
two paginations on one controller - by El Forum - 03-09-2008, 01:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB