-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Control rendered field in CSV export #1145
Comments
This comment has been minimized.
This comment has been minimized.
Hi @oliviertassinari, thanks for your quick response! Sorry for not following the issue template, but I though this was a question more than a bug. Thanks! |
@fanavarro Perfect, thanks for the reproduction. @DanailH I think that it's a follow-up on the CSV work you have started. (1.) It does seem wrong that we are not using the output of Regarding pushing the solution further. I didn't benchmark what the other data grid is doing regarding this matter. I imagine there is an opportunity to add many more options. I would be cautious, it might be best to move slowly here. It seems that (1.) is enough for this very problem. |
Somewhat on-topic with this: It would be great for the CSV export to respect valueFormatter in the output. We do some EPOCH conversions, as well as bool to Yes/No - CSV export is dumping the raw input (and encountering the comma issue, which massive +1 to the work on. #1143) Let me know if you want me to punt this to a separate issue for tracking |
@stevieg2123 thanks for raising this. @oliviertassinari yes we need to address the problem with the |
I would suggest not only to apply the valueGetter but also to provide a way to control how the raw data is rendered in the final CSV file. For example, a developer could want to show the main aspects of the data in the online table, but he or she could want to include other things that are hidden in this table when exporting to CSV. |
@fanavarro I don't follow, this is exactly what this issue is about since it was opened. Why reinforce this point? |
Hi @oliviertassinari. Sorry, I though the planned solution would be to simply apply the valueGetter when exporting the CSV. Misunderstanding from my part, my apologies. |
This was fixed in #1154 which is already included in the latest release. I'll close this issue and move the discussion about #1145 (comment) to #1814 because it's the same use case. |
Hi and thanks for your work, it is very useful.
I have been using the DataGrid component in an application for the last months. Now, I am trying to use the recently added CSV export functionality, but I am not sure about how to specify the render method for creating the CSV file.
Concretely, my data is formed by JSON objects, so I have to specify the 'valueGetter' prop when defining the columns in order to print a concrete field of my data in the DataGrid, and this works perfectly well. Now, I included the CSV export functionality as the documentation shows, and this adds the button for the CSV download. However, when I download the CSV, the cells contain the string "[object Object]".
I think there should be a property or something to specify a function to convert JSON object to the final CSV cell value, as someone recommended here, but I have been searching in the documentation and I have not found nothing relevant. What is the way to do this?
Thanks beforehand.
The text was updated successfully, but these errors were encountered: