0

I have an admin module, that lists orders.

One of the filters is a drop down, which lists the order_status and is a relation to the order_status table.

These order_id's are an id, from 1-10.

What I'm looking to do, is to filter by more than one of these order_id's.

So something like 1,2,3,4,5 or 6,7,8,9,10

Is this possible, or do I need to create a custom filter?

sipher_z
  • 1,221
  • 7
  • 25
  • 48

1 Answers1

1

Why not? Allow to your order widget multiple selections.

Set option 'multiple' => true

Update: Try to handle value of orders types manually. Here is example:

  public function addOwnGroupIdColumnQuery(Doctrine_Query $query, $field, $value)
  {
    if (!$value)
    {
      return;
    }

    $query->leftJoin($query->getRootAlias().'.OwnGroups pgr');

    $query->andWhereIn("pgr.id", $value);
  }

Locate this method into your filter class.

cuhuak
  • 498
  • 4
  • 9
  • Ok, I added the following: `$this->widgetSchema['status_id'] = new sfWidgetFormDoctrineChoice(array( 'model' => 'order_status', 'multiple' => true ));` which gave me: `SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens`. any ideas? – sipher_z Apr 15 '11 at 12:07
  • Try to use sfWidgetFormChoice instead of sfWidgetFormDoctrineChoice – cuhuak Apr 18 '11 at 06:26