This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Filters Help

Notes and reports about symfony 1.0.x stable

Filters Help

by Ciezo » Fri May 06, 2011 12:40 pm

Hello,

This question is about the filters that limit the number of simultaneously displayed items in the list view. By default, Symfony saves the last filter (on cache?) you applied when you change between modules.

┬┐How can I set by default not to save the last filter used in that list view?

Thx for any help !!!!!!!!!!!
Ciezo
Junior Member
 
Posts: 5
Joined: Mon Feb 07, 2011 2:21 pm

Re: Filters Help

by Ciezo » Thu May 12, 2011 5:12 pm

Hi everybody,

I will reply myself:

As you may guess, it only happens in modules auto-generated with "propel-init-admin" task. I just want to find a way that after filtering some field and listing the results, the next time I visit the module the filters are cleared.

I fixed it adding these two lines at the end of the function addFiltersCrtiera in the action.class of my generated module.

$this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/module_name'); $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/module_name/filters');

But I dont like this solution! I'm almost sure I could do it adding some parameters on generator.yml.

In symfony 1.4 it would work this way, but It does not work for 1.0, is there any way to make the same thing in 1.0?

filter:
display: [fieldname1, fieldname2, ...]
class: false

Thanksss!!!
Ciezo
Junior Member
 
Posts: 5
Joined: Mon Feb 07, 2011 2:21 pm