Answer the question
In order to leave comments, you need to log in
How to set up pagination for CGridView?
I use yiibooster.
TbGridView pagination not showing in view
$this->widget('booster.widgets.TbExtendedGridView', array(
'type' => 'hover condensed',
'responsiveTable' => true,
'pager' => array(
'class' => 'bootstrap.widgets.TbPager',
),
'filter' => $model,
'dataProvider' => $model->search(),
'template' => "{items}",
'columns' => array(
array ('name'=>'name', 'header'=>'Название'),
array ('name'=>'brand', 'header'=>'Марка автомобиля'),
array ('name'=>'count', 'header'=>'Количество'),
array(
'class'=>'booster.widgets.TbButtonColumn',
'htmlOptions'=>array('style'=>'width: 50px'),
'buttons'=>array(),
),
),
));
public function search() {
...
return new CActiveDataProvider($this, array(
'pagination'=>array(
'pageSize'=>10,
),
'criteria'=>$criteria,
));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question