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>
In this way you can add new action in existing grid.
If you have any query please comment below.
when I print the post parameters its returns
[key] => 2c7824dfa98ff4e9f550d2f4d07e696c650fbb48448ac3f8a8377f1c793e9294
[excluded] => false
[filters] => Array
(
[placeholder] => true
)
[search] =>
[namespace] => sales_order_grid
[form_key] => hvUs2LDFHbjJN3zY
how to get order ids in new created action controllers?