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] Is it possible to add reusable DataGrid GridToolbar components that make use of slots and slotProps? #13451

Closed
toddsmith-adsk opened this issue Jun 11, 2024 · 3 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: extend Logic customizability status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@toddsmith-adsk
Copy link

toddsmith-adsk commented Jun 11, 2024

The problem in depth

I'd like to create reusable GridToolbar components that make use of slots and slotProps. That would require us to use interface declaration merging to extend classes such as GridBaseSlots, GridSlotProps, GridPremiumSlotsComponent, etc. Is this approach viable? We'd also like to add custom panels as part of these toolbar components that leverage the existing preferences panels.

Your environment

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 18.19.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
    Edge: Chromium (125.0.2535.92)
  npmPackages:
    @emotion/react: ^11.11.4 => 11.11.4
    @emotion/styled: ^11.11.5 => 11.11.5
    @mui/base:  5.0.0-beta.40
    @mui/core-downloads-tracker:  5.15.17
    @mui/icons-material: ^5.15.17 => 5.15.17
    @mui/lab: ^5.0.0-alpha.170 => 5.0.0-alpha.170
    @mui/material: ^5.15.17 => 5.15.17
    @mui/private-theming:  5.15.14
    @mui/styled-engine:  5.15.14
    @mui/system:  5.15.15
    @mui/types:  7.2.14
    @mui/utils:  5.15.14
    @mui/x-data-grid:  7.4.0
    @mui/x-data-grid-generator: ^7.4.0 => 7.4.0
    @mui/x-data-grid-premium: ^7.4.0 => 7.4.0
    @mui/x-data-grid-pro:  7.4.0
    @mui/x-date-pickers: ^7.4.0 => 7.4.0
    @mui/x-license:  7.2.0
    @mui/x-license-pro: ^6.10.2 => 6.10.2
    @types/react: ^18.0.28 => 18.3.2
    react: ^18.2.0 => 18.3.1
    react-dom: ^18.2.0 => 18.3.1
    typescript: ^5.4.5 => 5.4.5

Search keywords: datagrid toolbar
Order ID: 86253

@toddsmith-adsk toddsmith-adsk added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Jun 11, 2024
@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! customization: extend Logic customizability support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/ labels Jun 12, 2024
@michelengelen
Copy link
Member

If I got this correctly it is the best approach indeed.
we have a section on the docs regarding module augmentation as well.

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 12, 2024
@michelengelen
Copy link
Member

If you have any other questions regarding this please don't hesitate to ask! 👍🏼

@michelengelen michelengelen changed the title [question] Is it possible to add reusable DataGrid GridToolbar components that make use of slots and slotProps? [data grid] Is it possible to add reusable DataGrid GridToolbar components that make use of slots and slotProps? Jun 12, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

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! customization: extend Logic customizability status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: premium standard Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

2 participants