-
-
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] Allow to remove column from CSV export #1435
Comments
As a workaround, you can already hide the columns you don't want to export. We could add an exportable flag in the column definition 🤔 |
That seems like the easiest solution with the least overhead. |
Is the pain frequent/important enough to have a dedicated prop? I don't think that have this information yet. How about we aim for the most generic solution instead? Something that allows to gain full control of the exported content of the CSV? If we could also benchmark how the other grid are solving this problem, it could also yield information. |
Also, I think that it would be more convenient to get a prop callback that would configure the export itself, the name of the export file, change the displayed data. An example of the same library that I am using for this - mui-datatables with prop |
@Neonin Agree, in the first iteration of the CSV feature, we went for the simplest solution with the smallest possible API surface, as we should have. This is what allows us to have conversions like this one, where developers report specific use cases. |
AgGrid just allows few options in their api. No panel. Kendo has a component for export that can takes some columns and data The aim of my solution was to take a pragmatic approach in order to fix the issue and unblock our users in brief delays. Then we could revisit this feature, and improve it slowly, incremental design. IMO, we should fix the following for the first version.
|
@dtassone So in the benchmark:
I agree with the 3 pains you have listed. It sounds great to solve them. Regarding the solution, 👍 for the solution of AG Grid. Have the export feature accept params. It could be both an argument in the apiRef and props in the toolbar export button. |
I agree with this. That was always part of the initial discussion. Seems that there is a demand for it now. Also if we are to go with this we should add an option for devs to pass in their own delimiter. |
Chiming in, I would love to use the formatted value in exports. Maybe resolve it like column rendering: |
@DanailH you can already pass your own delimiter If you call manually apiRef!.current.exportDataAsCsv({ delimiter: ';' }) If you use return (
<GridToolbarExport
csvOptions={{ delimiter: ';' }}
/>
) But this is not correctly documented. |
Solution is to use:
Example:
More details at: |
Summary 💡
I would like to be able to customize whether I need to export some columns.
Examples 🌈
https://codesandbox.io/s/github/gregnb/mui-datatables?file=/examples/csv-export/index.js:678-686
Motivation 🔦
For example with action columns.
Order id 💳
19652
The text was updated successfully, but these errors were encountered: