-
-
Notifications
You must be signed in to change notification settings - Fork 466
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
Example: feat - grouping with single group column #915
Example: feat - grouping with single group column #915
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
We can develop it, but I think we would have to add it to TanStack Table itself. |
I hope this feature will be released soon. For now, I'll use example code. When this feature is released, please tag me so I can know the information. |
Hi @KevinVandy, how can I get the total depth in the table? |
All other table instance apis listed here https://www.material-react-table.com/docs/api/table-instance-apis |
wait, somehow I didn't even know that single column grouping was easily possible in TanStack Table. I thought you were asking me to make the feature, didn't realize you did it. |
In the example, I've tried it out, but I hope you can integrate it and make it easier to use in a table via the props of the useMaterialReactTable hook. |
I'll look into this tomorrow. Logic seems pretty good here. You can try and see what needs to be done in the |
Okay, I will try it. |
Hi @KevinVandy , can you review it? |
Implement showOpenedGroup prop, refer to ideas from the following link: https://www.ag-grid.com/react-data-grid/grouping-single-group-column/#showing-open-groups |
Implement addColumnToLeafNode state, refer to ideas from the following link: https://www.ag-grid.com/react-data-grid/grouping-single-group-column/#adding-values-to-leaf-nodes |
@@ -357,6 +357,17 @@ export const tableOptions: TableOption[] = [ | |||
source: 'MRT', | |||
type: 'boolean', | |||
}, | |||
{ | |||
tableOption: 'enableGroupingSingleColumn', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we instead just use the already existing groupedColumnMode
option instead of adding this for the logic of whether to show a single column? Maybe not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use it.
This is good work. I want to see if the implementation can be simplified though. Can this be done with no new state or options? Or just 1 new |
You can split addColumnToLeafNode from state. Because I don't have much experience, I put it in the status for no special reason. |
About the |
Closing in favor of #916 , but I branched that PR off of this branch, so you are getting credit for this feature |
Hello @KevinVandy,
Currently, there is no single column group feature, I have made an example in the storybook.
Could you develop this into a library feature?
Reference: https://www.ag-grid.com/react-data-grid/grouping-single-group-column/