I am still very new to yii1 and fight now with a GridView. I have build a Search Form and when sending of the form, the page gets re-loaded and the GridView shows up with the results. The form goes to the Controller action and gets the appropriate records.
That works well, besides Pagination. As soon I click on the next page, the GridView is empty, if I refresh the Page, the GridView shows the results for that page. What am I doing wrong here? I have printed out the $dataProvider in my view and it seems to hold all the data, but the table shows no records. Any hint what I am doing wrong? I really hope someone can help. Thank you so much !
myController.php
$dataProvider = new CActiveDataProvider('MyModel', array(
'criteria'=>$criteria,
));
$this->render('overallSearch',
array(
'model'=>$model,
'dataProvider'=>$dataProvider,
));
myView.php (overallSearch.php)
$this->widget('zii.widgets.grid.CGridView', array(
'id' =>'search-grid-new',
'emptyText' => 'No records found',
'htmlOptions' => array('class'=>'grid-view search-grid'),
'dataProvider'=> $dataProvider,
'ajaxUpdate' => true,
'columns' => $columns,
));