OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions defalut filter from selected data

This topic contains 1 reply, has 2 voices, and was last updated by  zebimax 7 years, 10 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
  • #34151

    golriz.nourani
    Participant

    Hi
    I have a data grid which I select period of month as below

    – ONCAT(PYEAR(v.inTime),’/’,MONTH(v.inTime)) as monthPeriod
    – Max(ONCAT(PYEAR(v.inTime),’/’,MONTH(v.inTime))) as MaxmonthPeriod

    how could I set MaxmonthPeriod as default filter of monthPeriod ?

    Thanks,
    Golriz

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

    zebimax
    Participant

    Hi, Golriz.
    You have two options to solve your task:

      You need to create listener on oro_datagrid.datagrid.build.before event. Find your ‘MaxmonthPeriod’ value and add default filter to monthPeriod column by path ‘[filters][default]’ to datagrid configuration, which you can get from event.
      Create your custom filter which can handle your sql statement as a default value.
      You can get \Oro\Bundle\FilterBundle\Filter\StringFilter as a base.
Viewing 1 replies (of 1 total)

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

Back to top