Revision #2 was created by le_top on Nov 22, 2014, 6:51:47 PM.
Corrections to the text.
Title
How to simply keep filters simple in CGridView
Content
The problem is not new: after setting some filters in a grid (tiypically in admin view), and gone to another page, returning in the grid's page I would like to find the filters with previous setting mantained.
There are extensions doing that (and more) but I always look for the simplest solution. So, thanking some users that in various contributes approach the problem, this is the simplest way I found.
[...]
}
```
The added code to obtain the result is just a few lines, as follows:
```php
[...]
One step ahead
--------------
Some more to let clearing filters simpler too. Just a little action, and a link somewhere in the grid's page to call it.
```php
[...]
echo CHtml::link('Pulisci filtri', Yii::app()->controller->createUrl('pulisciFiltro'));
```
Destroying the variable, it restores the initial situation, clearing filters and setting, if present, the default values too.
It's all. Hope this is useful.