Learn to Fix Magento 2 Reset Button in Grid Column Not Working
Magento 2 Reset button in grid column not working? You’re at the right place then! Click here to directly jump to the solution.
Magento 2 UI component grid offers a simplistic view of data in tabular format, making it accessible to merchants. The merchant can also show/hide certain columns from the grid by using the Columns dropdown menu provided at the top-right corner of the grid. The Reset button is intended to restore the default configuration of columns.
It’s pretty helpful when you’re looking for specific data from your admin panel. You can switch back to the default columns by using the Reset button. Yet, if you’re developing a custom component UI grid in Magento 2, this functionality may need your extra attention. Recently, I came across a scenario where the Reset columns functionality in a custom grid was not working as expected.
In case you’ve created a custom admin UI grid in Magento 2, and the Reset columns button is not working, then this solution post is for you! Learn the complete method that I used to fix the Reset button not working for columns in Magento 2 admin UI grid.
Method to Fix Magento 2 Reset Button in Grid Column Not Working
There can be several reasons why the Reset button is not working in the admin UI grid in Magento 2. In most cases, this can be solved by defining bookmarks in the grid; follow these steps to do that:
- Step 1: Open the .xml file of the UI grid. It is present at app/code/Vendor/Module/view/adminhtml/ui_component/{grid_name}.xml
- Step 2: Add the following code within the listingToolbar node:
12345678910111213<listingToolbar name="listing_top">...<bookmark name="bookmarks"><argument name="data" xsi:type="array"><item name="config" xsi:type="array"><item name="storageConfig" xsi:type="array"><item name="namespace" xsi:type="string">customer_listing</item></item></item></argument></bookmark>...</listingToolbar> - Step 3:Flush Magento 2 cache by using the following command:
php bin/magento cache:flush
That’s it! Adding the bookmarks will fix the Reset button not working issue in the grid column and it will start working as expected 🙂
In case you still have any doubts or queries about Magento 2 reset button in Grid column not working, feel free to comment.
Feel free to share this post if it has helped you! Send it to your colleagues or share it on social media 😉
Gracias 🍀
Mahetab Saiyad
He is a Magento developer, who loves sharing technical tips and solutions. Being a coding enthusiast, he keeps exploring new concepts!
Prev
Shopify Bulk Editor – How to Bulk Edit in Shopify & Save Time
Shopify Checkout Page Customization: 10 Tips & Tricks for 2024
Next