cancel
Showing results for 
Search instead for 
Did you mean: 

"Invalid UI Component element name" error when exporting grid

"Invalid UI Component element name" error when exporting grid

I get following error when trying to export custom grid:

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid UI Component element name: ''

..view/adminhtml/ui_component/namespace_module_sales.xml

<?xml version="1.0"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">namespace_module_sales.namespace_module_sales_data_source</item>
            <item name="deps" xsi:type="string">namespace_module_sales.namespace_module_sales_data_source</item>
        </item>
        <item name="spinner" xsi:type="string">namespace_module_sales_columns</item>
    </argument>

    <dataSource name="namespace_module_sales_data_source">
        <argument name="dataProvider" xsi:type="configurableObject">
            <argument name="class" xsi:type="string">Namespane\Module\Ui\Component\Listing\DataProviders\Namespane\Module\Sales</argument>
            <argument name="name" xsi:type="string">namespace_module_sales_data_source</argument>
            <argument name="primaryFieldName" xsi:type="string">namespace_module_order_id</argument>
            <argument name="requestFieldName" xsi:type="string">id</argument>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="update_url" xsi:type="url" path="mui/index/render"/>
                    <item name="storageConfig" xsi:type="array">
                        <item name="indexField" xsi:type="string">namespace_module_order_id</item>
                    </item>
                </item>
            </argument>
        </argument>
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
            </item>
        </argument>
    </dataSource>

    <columns name="namespace_module_sales_columns">
        <column name="order_id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="sorting" xsi:type="string">asc</item>
                    <item name="label" xsi:type="string" translate="true">Order ID</item>
                </item>
            </argument>
        </column>
        <column name="order_amount">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">Order Amount</item>
                </item>
            </argument>
        </column>
        <column name="created">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">Created</item>
                </item>
            </argument>
        </column>
        <column name="reference">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">Reference</item>
                </item>
            </argument>
        </column>
    </columns>

    <listingToolbar name="listing_top">
        <paging name="listing_paging"/>
    </listingToolbar>

    <container name="page_listing_top">
        <exportButton name="export_button">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="selectProvider" xsi:type="string">namespace_module_sales.namespace_module_sales_columns.ids</item>
                </item>
            </argument>
        </exportButton>
    </container>

</listing>

Any thoughts?