how can I keep the filtered result in a CGridView when I go to a detailed view page and then go back to the admin view? I did not find anything in the forum, or maybe I just used the wrong questions and keywords. So please give me a hint, a link or even better a howto.
public function actionAdmin()
{
$model=new Wage('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['Wage']))
{
$model->attributes=$_GET['Wage'];
}
Yii::app()->user->setState('grid',$_GET);//saving all the get parameters into session.
$this->render('admin',array(
'model'=>$model,
));
}
views/wage/view.php.
Just append the following in view.php
if(Yii::app()->user->hasState("grid"))
{
$grid=Yii::app()->user->getState('grid');
$route=array("wage/admin");
echo CHtml::link("Return to Grid",array_merge($route,$grid));
Yii::app()->user->setState("grid",null);
}