Skip to content
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

[data grid] Selected rows not enforced on Print export #9993

Closed
2 tasks done
zreecespieces opened this issue Aug 10, 2023 · 2 comments · Fixed by #10084
Closed
2 tasks done

[data grid] Selected rows not enforced on Print export #9993

zreecespieces opened this issue Aug 10, 2023 · 2 comments · Fixed by #10084
Labels
component: data grid This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Export

Comments

@zreecespieces
Copy link
Contributor

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/cocky-booth-mw47xv?file=/Demo.tsx

Steps:

  1. Create a basic DataGrid example with columns and some data, this is cloned from a documentation sandbox
  2. Select a couple of rows using the selection checkboxes
  3. Click export -> Print -> Observe that all rows are exported, not just selected rows, incorrectly
  4. Click export -> Download as CSV -> Observe that only the selected rows are exported, as expected

Current behavior 😯

Selecting rows and then exporting using the 'Print' option results in all rows being exported not just the selected rows.

Expected behavior 🤔

When selecting rows and then exporting only the selected rows should be exported.

Context 🔦

I'm working on some educational content for MUI and found this behavior which appears to be a bug

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
Codesandbox, Chrome browser (Version 115.0.5790.114), MUI X Data Grid (Version 6.11.0)

Order ID or Support key 💳 (optional)

No response

@zreecespieces zreecespieces added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 10, 2023
@zreecespieces zreecespieces changed the title Selected Columns Not Enforced on Print Export Selected columns not enforced on Print export Aug 10, 2023
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Aug 11, 2023
@DanailH DanailH added regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 11, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Aug 11, 2023
@zreecespieces
Copy link
Contributor Author

PR submitted

@MBilalShafi MBilalShafi changed the title Selected columns not enforced on Print export [data grid] Selected rows not enforced on Print export Aug 20, 2023
@cherniavskii
Copy link
Member

I don't think this is a regression, it was an intentional behavior:
https://mui.com/x/react-data-grid/export/#print-export

We can enhance it by allowing to customize the exported rows.

@cherniavskii cherniavskii added enhancement This is not a bug, nor a new feature and removed regression A bug, but worse labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Export
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants