views:

117

answers:

1

The question is simple: how do I SHOW the ID field in the filter area, when using the admin generator?

I'm trying to include "id" in the display option, inside the filter section, but it is not appearing. I have no problem with the other fields.

I'm using Symfony 1.4.5

A: 

Ok, I found out that the ID field is not included by default in filters. So it must be defined in /lib/filter/doctrine/TableNameFilter.class.php this way:

  public function configure()
  {
    $this->setWidget('id', new sfWidgetFormFilterInput(array('with_empty' => false)));
    $this->setValidator('id', new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))));
  }
David