0

I would like to get the select dropdown button on the side of Action Dropdown,for my custom grid collection at admin end, how can i achieve it,I would like to display the same dropdown beside. For more info please find the below screen shot.enter image description here Thanks In advance.

1

2 Answers 2

0

You can try to add the function below in your module block grid:

protected function _prepareMassaction()
{
    $this->setMassactionIdField('post_id');
    $this->getMassactionBlock()->setFormFieldName('post_ids');

    $this->getMassactionBlock()->addItem('delete', array(
        'label'   => 'Delete',
        'url'     => $this->getUrl('*/post/massdelete'),
        'confirm' => 'Are you sure?',
    ));
}
1
  • that function already exists @TZY Commented Jun 7, 2018 at 15:28
0

You must create in your module a UI view/adminhtml/ui_component/product_listing.xml

<?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">
    <listingToolbar name="listing_top">
        <massaction name="listing_massaction">
            <action name="your_action">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="type" xsi:type="string">your_action</item>
                        <item name="label" xsi:type="string" translate="true">Your Action</item>
                        <item name="url" xsi:type="url" path="catalog/product/yourAction"/>
                    </item>
                </argument>
            </action>
        </massaction>
    </listingToolbar>
</listing>

After created UI, you must create the controller catalog/product/yourAction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.