Skip to content

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

Open
@oliviertassinari

Description

@oliviertassinari

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: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: data gridThis is the name of the generic UI component, not the React module!component: tree viewTreeView, TreeItem. This is the name of the generic UI component, not the React module!discussionfeature: Tree dataRelated to the data grid Tree data featurenew featureNew feature or requestwaiting for 👍Waiting for upvotes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions