Difference between #1 and #2 of
How to keep filters simple in CGridView

Changes

Title changed

How to simply keep filters simple in CGridView

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

CGridView, filtering

Content changed

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 t
he result is just a few lines, as follows:

```php
[...]
One step ahead
--------------
Some more to let cle
aring 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 de
fault values too. It's all. Hope this is useful.
0 0
2 followers
Viewed: 12 836 times
Version: 1.1
Category: How-tos
Written by: Peppe
Last updated by: le_top
Created on: Nov 22, 2014
Last updated: 9 years ago
Update Article

Revisions

View all history