Showing results for 
Search instead for 
Did you mean: 

To add default filter to grid

To add default filter to grid

I have created one custom module with title & status field attribute in admin grid.


Grid collections in module_test_grid_block.xml


             <argument name="id" xsi:type="string">testGrid</argument>
              <argument name="dataSource" xsi:type="object">Namespace\Module\Model\ResourceModel\test\Collection</argument>
              <argument name="default_sort" xsi:type="string">id</argument>
              <argument name="default_dir" xsi:type="string">desc</argument>                             
              <argument name="grid_url" xsi:type="url" path="*/*/grid"><param name="_current">1</param></argument>


I just want to show the datas which are enabled.Have any option to add default filter in admin grid collections?