开发者

symfony - doctrine admin generator filters and relations

I have an admin module, that lists orders.

One of the filters is a drop down, which li开发者_Go百科sts 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜