views:

11

answers:

1

Hi,

I have a working paginator. I combine Zend Paginator and jQuery to switch between pages. My problem is that the page links only have a range from 1 to 10 but it should be e.g. from 1 to 13. I can get to page 13 by clicking the forward button but the page link 13 is not displayed. alt text

Paginator setup:

$paginator = new Zend_Paginator ( 
    new Zend_Paginator_Adapter_DbSelect ( $programmeList ) );
$paginator->setItemCountPerPage ( 12 )
    ->setCurrentPageNumber ( $this->_getParam ( 'page', 1 ));

Pass paginator to the view:

if (! $this->_request->isXmlHttpRequest ()) {
    $this->view->paginator = $paginator;
} else {
    $this->view->currentPage = $paginator->getCurrentPageNumber ();
}

And this is how I print page links:

foreach ( $this->pagesInRange as $page ) {
    echo '<a href="#" id="page" page="'.$page.'">' . $page . '</a>';
}

Any ideas?

+1  A: 

Zend_Paginator has a setPageRange method which allows you to specify how many pages to show. It has a default of 10, which explains why $this->pagesInRange is always showing only 10 pages.

Bob Baddeley
thanks, it works now ;)
ArtWorkAD