In one of my views, whenever there are multiple pages in my CGridView, it won’t change the page data. The pagination part will switch to ‘11-20 of 28 result(s)’, but the data won’t actually change.
Here is my controller:
public function actionAdminResults($id){
$model=new Response('search');
$model->unsetAttributes();
if(isset($_GET['Response'])){
$model->attributes=$_GET['Response'];
}
$model->Form_ID=$id;
$this->render('adminresults',array(
'model'=>$model,
));
}
and in my view:
...
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'response-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
array(
'name'=>'Question_ID',
'header'=>'Question',
'value'=>'Questions::model()->findByPk($data->Question_ID)->Question',
'filter'=>CHtml::listData(Forms::model()->findByPk($_GET['id'])->Questions, 'ID', 'Question'),
),
'Response',
'Responder',
),
)); ?>
...
and my search method is just the default, nothing special.
Edit:
When I switch
$model=new Response('search');
to a different model, it works…