OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Datagrid filtering two columns using one filter

This topic contains 1 reply, has 2 voices, and was last updated by  Dmitriy Pasechnik 6 years, 11 months ago.

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

  • Creator
    Topic
  • #25406

    wojtekson16
    Participant

    Hello,

    I’ve got a question related to the datagrid… Inside datagirid.yml there is date filter on one of columns, but I want also to append this date filter to another column(without creating new filter on front), so it filter two columns at once. Is there any additional parameter in filter config so I could easily achieve it? If it’s not possible is there a way to write own custom filter and within it append two columns filter?

    Thanks you in advance for any answers and help.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #25407

    Dmitriy Pasechnik
    Participant

    Hello wojtekson16.

    Unfortunately, you cant use existing filters to filter grid by 2 columns at once.
    But, of course, you always can create your own filter.
    To implement it you have to do following:

    1) Develop class that implements Oro\Bundle\FilterBundle\Filter\FilterInterface (also take a look at current implementation of \Oro\Bundle\FilterBundle\Filter\AbstractDateFilter and its heir \Oro\Bundle\FilterBundle\Filter\DateRangeFilter – its a current implementation of ‘date’ filter, so you can use it as a basis)
    2) Register you filter as service with tag { name: oro_filter.extension.orm_filter.filter, type: YOUR_FILTER_TYPE }

Viewing 1 replies (of 1 total)

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

Back to top