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>
- 
 What is "selectProvider"? I don't see this setting for exportButton component.Sergii Ivashchenko– Sergii Ivashchenko2017年02月03日 18:04:51 +00:00Commented Feb 3, 2017 at 18:04
- 
 even I am facing the same issueVigna S– Vigna S2017年02月22日 10:12:33 +00:00Commented Feb 22, 2017 at 10:12
2 Answers 2
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
- 
 It works fine. But I can see one more column in the grid with the checkbox(Mass action). How to fix the issuw without adding new columnMeenakshiSundaram R– MeenakshiSundaram R2017年05月12日 12:20:26 +00:00Commented May 12, 2017 at 12:20
- 
 magento.stackexchange.com/questions/251608/…Naveenbos– Naveenbos2018年11月28日 12:17:48 +00:00Commented Nov 28, 2018 at 12:17
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
Explore related questions
See similar questions with these tags.