-
Notifications
You must be signed in to change notification settings - Fork 932
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
Is there any simple way to group rows? #904
Comments
It depends on what you mean by "group." Column headers allow sorting, and you can define a custom sort which will group along any column values you want. |
I only need the sorting on the first column, which is my parent's CustomerPo field. But I would like the filters and view columns to work. |
So, this library is not really built to handle nested data in the way you are attempting to handle it, so there's not going to be a good way to force it in and then rely on the other functions like filters, search, download, etc. We have to keep in mind that this library is built on top of the material Google recommendations for data tables, so I don't want to stray too far from that. Material specs have guidelines around the way that certain data is presented and your case is well outside of those specs, so it's a bit out of scope. That being said, here are some suggestions for things you might try, albeit with different UX.
|
I actually solved this quite nicely without having to write any "hacky" code. :) If you want an example I'd be happy to share :) |
Sure, feel free to open a PR with the example and I'll take a look! |
Hi @sarawinter We would also like to implement a similar scenario, could I kindly ask you to share your solution? Thanks! 😄 |
Hi @sarawinter , If you share your solution, we will be happy :) |
Hi @sarawinter. Can you share your solution with us? |
any chance you can share your code @sarawinter ??? |
This table should definitley support grouping natively. The solution @sarawinter describes is mostly a product of this table being so flexable. However, theoretically it should be pretty straight forward to add native support. A "grouping" option could be added, and if present, the table would transform the internal data structure in a way that's similar to how sara did her's. Then, the table could present an expand arrow that would render this data when expanded. The only tricky parts would be handling filters (which may not be too bad), and handling nested data. I'm thinking the API could look like this for a simple case:
And this for a nested case:
Though I'll need to think about this some. This will probably be the next thing I tackle after the draggable columns PR is complete. |
@sarawinter any chance you can expand on your solution? |
Hi, sorry, but I have left the project where I was working with this library. |
Thank you Sara! I've actually decided to go a separate direction for my project, but I'm sure the others in this thread would be thankful for that.
…On Thu, Jul 16, 2020 at 12:27 AM, sarawinter < ***@***.*** > wrote:
Hi, sorry, but I have left the project where I was working with this
library.
But I will see if I can make a mock version of the solution we used now
that I have a little extra time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (
#904 (comment)
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AA4DDINQRI2TVXM2F3MUFFLR32TXPANCNFSM4IUYVWYA
).
|
Beta version of a grouping feature has been submitted as a PR here: #1441 |
I am wondering if there is any easy way to group rows by a common field/column value, such as a date field?
The text was updated successfully, but these errors were encountered: