OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Datagrid Choice Filter Contains/With Wildcard

This topic contains 2 replies, has 2 voices, and was last updated by  archy_bold 6 years, 3 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #34170


    Hi there.

    I’m trying to set up a datagrid choice filter for one of my columns, I’ve had no issues doing this in the past, but what I want to do differently this time is not match the string exactly, but match with a wildcard. I have the following filter:

    Which works fine for any status of ‘Finished.Completed’ or ‘Finished.Failed’ as these can match my status exactly. The issue comes with the ‘Shopping’ status, which can be ‘Shopping.Ongoing’ or ‘Shopping.Checkout’. Basically I want to match anything that starts with ‘Shopping’.

    I’ve tried various things but the documentation is really lacking for the choice filters. Any tips on how to achieve this? Do I need to write a custom filter?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #34171

    Mike Kudelya


    Yes, you can create new custom filter, for example (If you didn’t create our custom bundle, create it and extend from FilterBundle):

    Create custom Custom/Bundle/FilterBundle/Filter/SelectLikeFilter.php:

    Register it in Custom/Bundle/FilterBundle/Resources/config/services.yml:

    Create js file Custom/Bundle/FilterBundle/Resources/public/js/filter/select-like-filter.js:

    Register js file in Custom/Bundle/FilterBundle/Resources/config/requirejs.yml:

    Don’t forget run these commands:

    Now you ready to change your filter type from choice to select-like and use “Shopping.%”: Shopping options



    Brilliant! It works with a couple of modifications to SelectLikeFilter. Just with an extra use for FilterUtility and with wildcards round the $value when setting the query parameter. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top

You will be redirected to [title]. Would you like to continue?

Yes No

You will be redirected to [title]. Would you like to continue?

Yes No