In Magento 1 one could add a custom button on the product grid using the layout handle.
One would add the following to local.xml
<layout version="0.1.0">
<!-- ... -->
<adminhtml_catalog_product_index>
<reference name="products_list">
<action method="addButton">
<id>my_button_identifier</id>
<data>
<label>My button</label>
<class>some-class</class>
<onclick>some_click_action_here</onclick>
</data>
</action>
</reference>
</adminhtml_catalog_product_index>
<!-- ... -->
</layout>
- Is this possible in Magento 2? If so how?
I've tried with no luck:
Vendor/Module/view/adminhtml/layout/catalog_product_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="products_list">
<action method="addButton">
<argument name="buttonId" xsi:type="string">button_id</argument>
<argument name="data" xsi:type="array">
<item name="label" xsi:type="string">Button Label</item>
<item name="class" xsi:type="string">primary</item>
<item name="url" xsi:type="string">frontname/controller/controller</item>
<item name="class_name" xsi:type="string">Magento\Backend\Block\Widget\Button</item> <!-- Tried without this node as well -->
</argument>
</action>
</referenceBlock>
</body>
</page>
EDIT
I can confirm that the addButton Method is called for my input, yet the button still is not displayed in frontend