material-table-core / core

Datatable for React based on material-ui's table with additional features. Support us at https://opencollective.com/material-table-core
https://material-table-core.github.io
MIT License
296 stars 146 forks source link

Grouping by column breaks the table if tree data exists #771

Closed DavidLemayian closed 1 year ago

DavidLemayian commented 1 year ago

Describe the bug

Grouping by column breaks the table if tree data (parentChildData option) exists

To Reproduce

  1. Setup from demo:

    <MaterialTable
      data={TREE_DATA}
      columns={TREE_COLUMNS}
      parentChildData={(row, rows) => rows.find((a) => a.id === row.parentId)}
      options={{
        selection: true,
        grouping: true,
        showGroupingCount: true
      }}
    />
  2. and then drag a column to be grouped

Sandbox: https://codesandbox.io/s/nervous-swirles-7427gu?file=/src/App.js:1384-1707

nervous-swirles-7427gu---CodeSandbox.webm

Domino987 commented 1 year ago

@DavidLemayian Hi, thanks for reporting this. I am also not sure (apart from the obvious error) on how these two would work together. Would you mind providing an example on how you would expect grouping and tree data to behave in this case?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.