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] PrintOptions hideFooter: true, hideToolbar: true not working #6845

Open
2 tasks done
acetine63 opened this issue Nov 14, 2022 · 1 comment
Open
2 tasks done
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Export plan: Pro Impact at least one Pro user support: question Community support but can be turned into an improvement

Comments

@acetine63
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:
1.
2.
3.

Current behavior 😯

When hideFooter and hideToolbar are set to true, export to print should hide both the toolbar and the footer however it is not working.

Expected behavior 🤔

Both the footer and toolbar should be hidden in the print document.

Context 🔦

No response

Your environment 🌎

<StripedDataGrid
              key={bomRows}
              rows={bomRows}
              columns={columnsBOM}
              disableSelectionOnClick
              printOptions={{
                hideFooter: true,
                hideToolbar: true,
              }}
              initialState={{
                columns: {
                  columnVisibilityModel: {
                    callout: false,
                    coordinate: false,
                    option_code: false,
                  },
                },
                sorting: {
                  sortModel: [{ field: "id", sort: "asc" }],
                },
              }}
              rowHeight={18}
              headerHeight={18}
              pageSize={pageSize}
              onPageSizeChange={(newPageSize) => setPageSize(newPageSize)}
              rowsPerPageOptions={[50, 100, 250, 500]}
              pagination
              components={{ Toolbar: GridToolbar }}
              componentsProps={{
                toolbar: {
                  showQuickFilter: true,
                  quickFilterProps: { debounceMs: 500 },
                },
              }}
            />

Order ID 💳 (optional)

44275

@acetine63 acetine63 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 14, 2022
@m4theushw m4theushw added component: data grid This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 14, 2022
@m4theushw
Copy link
Member

To use printOptions you need to pass it to componentsProps.toolbar or directly to <GridToolbarExport>. In the example provided it's misused. Could you test again using it in that way? More information: https://mui.com/x/react-data-grid/export/#customize-grid-display

@m4theushw m4theushw changed the title DataGridPro PrintOptions hideFooter: true, hideToolbar: true not working [data grid] PrintOptions hideFooter: true, hideToolbar: true not working Nov 14, 2022
@m4theushw m4theushw added plan: Pro Impact at least one Pro user feature: Export support: question Community support but can be turned into an improvement labels Nov 14, 2022
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! feature: Export plan: Pro Impact at least one Pro user support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

2 participants