简体   繁体   English

如何用出口商出口所有领域? (反应管理员)

[英]How to export all fields with exporter ? (react-admin)

I created my react-admin exporter to export my data. 我创建了react-admin导出器来导出数据。 But the problem is that I only get the fields I display in my list when I want to export all the fields (even those visible in edit or display). 但是问题是,当我要导出所有字段(即使是在编辑或显示中可见的字段)时,我只会得到显示在列表中的字段。 Even with fetchRelatedRecords I don't recover all the data. 即使使用fetchRelatedRecords我也无法恢复所有数据。 How to export all existing fields ? 如何导出所有现有字段? For example, I display id and name in the table. 例如,我在表中显示ID和名称。 In add and edit I have other fields available in addition to these. 在添加和编辑中,除了这些之外,我还有其他可用字段。 I want to export all the fields in my database and not just those displayed in the table. 我想导出数据库中的所有字段,而不仅仅是导出表中显示的那些字段。

The export function does not care about the fields you chose to display. 导出功能不关心您选择显示的字段。 As explained in the documentation , the export button will call the dataProvider with the current sort and filter (but without pagination) and transform all the fields of the records in the dataProvider response into a CSV string. 文档中所述,导出按钮将使用当前的排序和过滤器(但不分页)调用dataProvider,并将dataProvider响应中记录的所有字段转换为CSV字符串。

So if some fields aren't there, it means your API did not return them. 因此,如果某些字段不存在,则意味着您的API没有返回它们。 Be advised that the dataprovider call the same endpoint as for the list so make sure that when the API doesn't receive pagination params in this request, it returns the data expected for exports 建议dataprovider调用与列表相同的终结点,因此请确保当API在此请求中未收到分页参数时,它返回预期导出的数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM