Reading list Switch to dark mode

    Create New Mass Action To Existing Grid – Magento2.0.x

    Updated 27 January 2023

    Here we will see how to add new mass action in any existing grid.
    For this first of all create uiComponent xml file in our module with same name of the existing grid’s uiComponent xml file.
    And after that add new mass action in product’s grid in magento admin.

    Create product_listing.xml file in location “Namespace/ModuleName/view/adminhtml/ui_component” and add new action.

    <?xml version="1.0" encoding="UTF-8"?>
    <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
        <container name="listing_top">
            <massaction name="listing_massaction">
                <action name="export_products">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="type" xsi:type="string">export_products</item>
                            <item name="label" xsi:type="string" translate="true">Export Product Names</item>
                            <item name="url" xsi:type="url" path="modulename/controller"/>
                        </item>
                    </argument>
                </action>
            </massaction>
        </container>
    </listing>

    Mass Action

    In this way you can add new action in existing grid.

    If you have any query please comment below.

    Searching for an experienced
    Magento 2 Company ?
    Find out More
    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    3 comments

  • Tomas Jindal
  • Steve
    • Rahul
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home