You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new grid with a simple collection as a source.
Add a joined and aliased column from another table on the collection in a custom GridCollectionProcessor
Add the field as filterable in the grid xml config file
Try to filter the field on the magento admin frontend
/!\ I only tried this with a text field, but I guess this is the same for any other column type.
If I remember well, in the magento 1 grid builder we had to add a "filter_index" attribute on the column definition to let the grid know that it must filter with the real "table.column_name" instead of the alias.
Maybe it could be a solution
The text was updated successfully, but these errors were encountered:
Considered mapping field names to their aliases in the Navigation::getSearchCriteria view model method, but dismissed the idea because it would expose the view model to the implementation details of the underlying grid source type.
The other likely solution is to use a HyvaGridSourceProcessor::beforeLoad method in \Hyva\Admin\Model\GridSourceType\CollectionGridSourceType::fetchData before the search criteria is applied to the collection. Dismissed this idea because mutating the search criteria would cause multiple loads.
The next option would also be applied in \Hyva\Admin\Model\GridSourceType\CollectionGridSourceType::fetchData, but instead of using a processor, hardcode the mapping of aliases to real column names for flat table collections. This would probably involve cloning the search criteria after the processor beforeLoad methods where called to avoid duplicate loading.
Steps to reproduce :
/!\ I only tried this with a text field, but I guess this is the same for any other column type.
If I remember well, in the magento 1 grid builder we had to add a "filter_index" attribute on the column definition to let the grid know that it must filter with the real "table.column_name" instead of the alias.
Maybe it could be a solution
The text was updated successfully, but these errors were encountered: