This topic contains 3 replies, has 2 voices, and was last updated by Rodolfo 7 years, 11 months ago.
- Topic
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:
12345678910111213141516171819202122232425public function buildBefore(BuildBefore $event){if ('website-tracking-events-grid' !== $event->getConfig()->getName()) {return;}$fieldsToCustomize = ['name','value','userIdentifier','code'];foreach($fieldsToCustomize as $field) {$event->getDatagrid()->getConfig()->offsetSetByPath('[filters][columns][' .$field. '][options][operator_choices]', ['is equal to','is empty','is not empty','is any of','is not any of']);}}Thank you very much.
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.