ssossossossosso

Forums

Forums OroPlatform OroPlatform – Programming Questions buildBefore/buildAfter on Extended Datagrid Filters?

This topic contains 3 replies, has 2 voices, and was last updated by  Rodolfo 1 year, 9 months ago.

  • Creator
    Topic
  • #28641

    Rodolfo
    Participant

    Hi Oro Community,

    How can I customize a datagrid filter when I have a field that was added using the entity management?

    I’m extending and overriding TrackingBundle in order to remove some wildcard filters (contains, does not contains) from ‘website-tracking-events-grid‘. When you have some millions of rows, full-text-search becomes a very heavy query for this tracking datagrid.

    I managed to customize most of my fields with Event Listener (buildBefore) and I would like to make the same action for Extended Datagrid Fields. These extended fields are not showing up when I call $event->getDatagrid().

    This is the snippet of code I’m using to override the filters for the fields that come with TrackingBundle:

    Thank you very much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #28642

    Yevhen Shyshkin
    Participant

    Hello, Rodolfo.

    Easy solution – you can use BuildAfter event – at this moment configuration already contains all required infoermation

    Alternative solution – you ca create grid extension (for example, here is extension that adds all such fields). You should create your own extension (usually extended from AbstractExtension) and do required fixes in on the methods (processConfigs in your case).

    #28643

    Yevhen Shyshkin
    Participant

    Also, instead of manual grid name checking you can use custom event names.

    #28644

    Rodolfo
    Participant

    Always with the best answers! Thank you very much @yshyshkin !

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

You must be logged in to reply to this topic.