teone
teone

Reputation: 2183

Yii ClistView Pagination set number of page shown in Pager

Hi think this is a quite easy problem, but I can't find the solution in the docs. I'm using Yii ClistView to paginate my results and everything works great, simply (as I could have a lot of results) I would like to limit non the result but the page shown in the navigation (that are ten by default) to let's say 4. But I won't limit the number of my results, just when I reach the 4th page the navigation will slide (as its default behavior) to show page 5, 6, ecc...

Is this possible? Does anyone have advice?

Thanks in advance!

Upvotes: 1

Views: 1799

Answers (1)

Martin Komara
Martin Komara

Reputation: 767

How about setting pager's maxButtonCount like this:

$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$dataProvider,
    // ...
    'pager' => array('maxButtonCount' => 4),
));

Upvotes: 3

Related Questions