Skip to content

[data grid][tree view] Support different data structure #17197

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

Open
oliviertassinari opened this issue Mar 30, 2025 · 0 comments
Open

[data grid][tree view] Support different data structure #17197

oliviertassinari opened this issue Mar 30, 2025 · 0 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! discussion feature: Tree data Related to the data grid Tree data feature new feature New feature or request waiting for 👍 Waiting for upvotes

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 30, 2025

Summary

The data grid data structure for trees is https://mui.com/x/react-data-grid/tree-data/

const rows: GridRowsProp = [
  { path: ['Sarah'], jobTitle: 'CEO', id: 0 },
  { path: ['Sarah', 'Thomas'], jobTitle: 'Head of Sales', id: 1 },
  { path: ['Sarah', 'Thomas', 'Robert'], jobTitle: 'Sales Person', id: 2 },
  { path: ['Sarah', 'Thomas', 'Karen'], jobTitle: 'Sales Person', id: 3 },
]; 

It's different from the data structure for tree view https://mui.com/x/react-tree-view/rich-tree-view/items/.

const MUI_X_PRODUCTS: TreeViewBaseItem[] = [
  {
    id: 'grid',
    label: 'Data Grid',
    children: [
      { id: 'grid-community', label: '@mui/x-data-grid' },
      { id: 'grid-pro', label: '@mui/x-data-grid-pro' },
      { id: 'grid-premium', label: '@mui/x-data-grid-premium' },
    ],
  },

In both cases, the data is likely stored in a relational database, so I wonder about the value of supporting both structures for both components.

I'm opening this issue to see if people from the community have thoughts around it.

Examples

No response

Motivation

No response

Search keywords: -

@oliviertassinari oliviertassinari added new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer component: data grid This is the name of the generic UI component, not the React module! discussion feature: Tree data Related to the data grid Tree data feature component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! labels Mar 30, 2025
@flaviendelangle flaviendelangle added waiting for 👍 Waiting for upvotes and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 31, 2025
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! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! discussion feature: Tree data Related to the data grid Tree data feature new feature New feature or request waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

2 participants