UI ExportButton Component
ExportButton Component is responsible for export grid data to specified data format (cvs, xml, and so on).
To enable ExportButton Component add exportButton element with specified selectProvider item to listing configuration file.
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">{select_provider_path}</item>
</item>
</argument>
</exportButton>
Example: Magento/Sales/view/adminhtml/ui_component/sales_order_grid.xml
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<container name="listing_top">
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">sales_order_grid.sales_order_grid.sales_order_columns.ids</item>
</item>
</argument>
</exportButton>
</container>
</listing>
By default Magento allows CSV and Excel XML export data formats.
How to add new export format
To add new export format:
- Add configuration data to ExportButton definition
Magento/Ui/view/base/ui_component/etc/definition.xml
- Add controller for new format processing
\Magento\Ui\Controller\Adminhtml\Export\GridToFoo
- Add converter
\Magento\Ui\Model\Export\ConvertToFoo
Find us on