3

When I tried to export data to Csv or xml from ui grid in magento2 it says:

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

I had added export button. My code is given below:

<listingToolbar 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">custom_order_grid.custom_order_grid.custom_order_columns.ids</item>
            </item>
        </argument>
   </exportButton>
<listingToolbar>
2
  • What is "selectProvider"? I don't see this setting for exportButton component. Commented Feb 3, 2017 at 18:04
  • even I am facing the same issue
    – Vigna S
    Commented Feb 22, 2017 at 10:12

2 Answers 2

6

I have found the issue,

Inside columns tag, you need to have selectionsColumn .

<columns name="custom_order_grid_data_columns">
  <selectionsColumn name="ids">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="indexField" xsi:type="string">id</item>
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
    </selectionsColumn>
     <column name="column_name">
     .
     .
     </column>
</columns>

Once selectionsColumn is added the export works fine

2
2

Add below code in your custom grid XML

<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">custom_listing.custom_listing.custom_columns.ids</item>
            </item>
        </argument>
    </exportButton>
</container>

Please visit below link for more information:

http://devdocs.magento.com/guides/v2.0/ui-components/ui-export.html

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.