Magento admin grid filter values
Getting the filter values from an grid within the Magento admin can be a tricky task and is not very straight forward. In my case I required these values for a custom order export type to build a proper file name. After digging around in the code I found a way.
The following code can be used within a custom controller to fetch a simple array of all the chosen filters within a grid (
sales_order_grid as example):
If you would be extending an existing grid class instead of calling one from the controller, for example one that extends
$this and use the following code within that grid class: