I created a grid in admin using XML interface components. I need to filter a collection through a URL parameter, and I don't know how to achieve this. I tried to enter RequestInterface into the collection, but the filter did not work.
di.xml
<virtualType name="SlideListingDataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
<arguments>
<argument name="collection" xsi:type="object" shared="false">xxx\xxx\Model\ResourceModel\Grid\Slide\Collection</argument>
<argument name="filterPool" xsi:type="object" shared="false">SlideListingFilterPool</argument>
</arguments>
</virtualType>
<virtualType name="SlideListingFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
<arguments>
<argument name="appliers" xsi:type="array">
<item name="regular" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item>
<item name="fulltext" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item>
</argument>
</arguments>
</virtualType>
<virtualType name="xxx\xxx\Model\ResourceModel\Grid\Slide\Collection" type="xxx\xxx\Ui\Component\DataProvider\SearchResult\Slide">
<arguments>
<argument name="mainTable" xsi:type="string">advox_sliders_slide</argument>
<argument name="resourceModel" xsi:type="string">xxx\xxx\Model\ResourceModel\Slide</argument>
</arguments>
</virtualType>
source
share