Is there an option in TbExtendedGridView widget where you can set the items to be shown in each page? I currently have this setting
$this->widget('bootstrap.widgets.TbExtendedGridView',array(
'id' => 'client-list',
'dataProvider'=>$model->search(),
'filter'=>$model,
'type' => array('striped', 'bordered', 'condensed'),
'template' => '{pager}{summary}{items}{pager}',
'pagerCssClass' => 'pagination',
'rowCssClass' => 'pagination',
'pager' => array(
'header' => '',
'hiddenPageCssClass' => 'disabled',
'maxButtonCount' => 3,
'cssFile' => false,
// 'class' => 'pagination',
'prevPageLabel' => '<i class="icon-chevron-left"></i>',
'nextPageLabel' => '<i class="icon-chevron-right"></i>',
'firstPageLabel' => 'First',
'lastPageLabel' => 'Last',
'htmlOptions'=>array('class'=>'your_css_class'),
),
'columns'=>$gridColumns,
'responsiveTable' => true,
'enablePagination' => true,
));
EDIT
Thanks to @ineersa for the answer. I've modified my model's search function from this:
public function search() {
$criteria=new CDbCriteria;
$criteria->compare('first_name',$this->first_name,true);
$criteria->compare('last_name',$this->last_name,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
to this:
public function search() {
$criteria=new CDbCriteria;
$criteria->compare('first_name',$this->first_name,true);
$criteria->compare('last_name',$this->last_name,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination'=>array('pageSize'=>20),
));
}