icflorescu / icflorescu/mantine-datatable
Row expansion and nested table: nested row instead of nested tables
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
When using the nested table feature, if the nested table data has the same type than the parent table, there is an issue with columns width not maching parent columns width, it's also not compatible with column resizing.
Of course we can use fixed columns width some issues, but it then adapt poorly to dynamic content.
Describe the solution you'd like
Instead of adding an extra row with colspan and a new table inside, we could have an option to set new rows.
We can't use collapse with table tr, but in this example we can see a way to animate toggling rows : https://stackoverflow.com/a/37376274
We could have an extra property to add new content "as rows":
return (
<DataTable
withTableBorder
withColumnBorders
columns={[{ accessor: 'name' }, { accessor: 'city' }, { accessor: 'state' }]}
records={records}
rowExpansion={{
rows: [], // 👈 set this to add new "nested" rows
// ...
}}
/>
);
This could exists along with the content property to both add rows and nested content (and not breaking curent implementations)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the DataTable rowExpansion implementation and existing content behavior, then compare the proposed rows API with the linked table-row animation example. Done means nested same-type data can render as rows aligned with parent columns and coexist with content without breaking current implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100