ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 1 reply, has 2 voices, and was last updated by zebimax zebimax 1 year, 4 months ago.

  • Creator
    Topic
  • #18074
    golriz.nourani
    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
  • #18172
    zebimax
    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)

You must be logged in to reply to this topic.