I am working with a CGridView. I am wanted to take the filter value (The actual value under the table header that is being filter and/or if the column is asc/desc) and set its value/values to a session variable, so that when leaving the page and coming back I can use the filter values again. From my exploration of the forum this is what I have gathered:
To get the CGridView filter parameters I need to use one of the follow:
Yii::app()->request->getParam(‘name’);
CHttpRequest::getParam(‘name’);
$_GET[‘name’];
To set a session:
Yii::app()->session[‘filterName’] = $x
Now where do I get the CGridView filter parameters? in the controller, view, model? And how do I set the CGridView filter parameters to my session variable?
I have added your code and now the filter for that column does not work. Also if I add the following code and enter a value in the filter hit enter nothing gets printed. If I leave the page and come back nothing gets printed:
I don’t think Yii::app()->getParam(‘name’) is receiving the parameter. The actual name of the model I am using is called “Dealers”. In that model there is a field called “name” that I am need to capture the filter/sorting of it’s CGridView in a certain view. I hope that better clarifies my question.