I'm trying to override the Export button of the Admin Orders Grid, to add another custom CSV export with fixed columns
The goal for the custom option is to always export the same columns, without changing the default behavior of CSV and Excel XML filtered columns. Something to do with the dataProvider I guess
Code:
../view/adminhtml/ui_component/sales_order_grid.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">
<exportButton class="Magento\Ui\Component\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 name="options" xsi:type="array">
<item name="cvs_test" xsi:type="array">
<item name="value" xsi:type="string">csv_custom</item>
<item name="label" xsi:type="string" translate="true">CSV_CUSTOM</item>
<item name="url" xsi:type="string">mui/export/gridToCsv</item>
</item>
</item>
</item>
</argument>
</exportButton>
</listingToolbar>
</listing>
added this also
Modify the sales_order_grid layout file (optional): If you want to override the sales_order_grid layout file to include your custom UI component, create the view/adminhtml/layout/sales_order_grid.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="adminhtml.sales.order.grid.additional">
<block class="Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface"
name="custom_export_button">
<arguments>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="options" xsi:type="array">
<item name="csv_custom" xsi:type="array">
<item name="visible" xsi:type="boolean">true</item>
<item name="label" xsi:type="string"