Revision #2 has been created by le_top on Nov 22, 2014, 6:51:47 PM with the memo:
Corrections to the text.
« previous (#1)
simply keep filters in CGridView
The problem is not new: after setting some filters in a grid (t
ipically 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 te result is just a few lines, as follows:
[...]One step ahead
Some more to let cle
ring filters simpler too. Just a little action, and a link somewhere in the grid's page to call it.
[...]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
ault values too.
It's all. Hope this is useful.