Magento 2.2.5 – Filter Admin Grid Based on URL Parameter

filtergridmagento-2.2.5

In Magento 2.2.5, I have a custom agrid. It has edit option and url parameters.

I need to create another grid in the edit page based on the url parameter. ie., I need to filter the custom grid based on the url parameter.

Note: Am not using ui component to create grid.

Code: https://pastebin.com/z9aww705

Screenshot

Best Answer

Please find below line in your ui component file.

<item name="update_url" xsi:type="url" path="mui/index/render"/>

After that add below code after that line.

<item name="filter_url_params" xsi:type="array"> 
     <item name="id" xsi:type="boolean">1</item>
 </item>

You can get filter data in your grid.

Still you have any query let me know.

Related Topic