Skip to content
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

Multiple groupField issue #2333

Closed
Suribabu-Balam opened this issue Sep 30, 2021 · 10 comments
Closed

Multiple groupField issue #2333

Suribabu-Balam opened this issue Sep 30, 2021 · 10 comments
Labels
Type: New Feature Issue contains a new feature or new component request

Comments

@Suribabu-Balam
Copy link

Suribabu-Balam commented Sep 30, 2021

Hi Team,

Could you please suggest me how way to implement multiple groupField in row group data table.

image

Thanks.

@master117
Copy link
Contributor

https://primefaces.org/primereact/showcase/#/datatable
https://primefaces.org/primereact/showcase/#/datatable/rowgroup
https://primefaces.org/primereact/showcase/#/datatable/colgroup

You can use the rowSpan field to define multiple rows for one datapoint.

Please note that it is bad manners to tag people to get a faster response.

@Suribabu-Balam
Copy link
Author

Okay, Thank you for your response.

@Suribabu-Balam
Copy link
Author

Hi Team,

rowGroupMode="rowspan"
groupField="Field1,Field2"
sortMode="multiple"
sortField="Field1,Field2"
sortOrder={1}

We tried the above-mentioned code like that but not working. Please help me with the issue.

Thanks in advance.

@master117
Copy link
Contributor

Please show a whole sample using the code sandbox link provided when opening a new ticket.

@Suribabu-Balam
Copy link
Author

Hi Team,

Code sandBox link: https://codesandbox.io/s/charming-cloud-8y2yz
Please look into the above code sandbox link. We followed that reference code.

How way to set multiple groupFields in a single table issue.

Thanks in advance.

@master117
Copy link
Contributor

master117 commented Oct 6, 2021

Ok, now I understand your problem. Primereact does not offer a way to group by multiple columns. The easiest approach would be to write a grouping algorithm (or import one, like d3.nest) to group your data. And then create rows from this data, with only the first row having all fields.

Like this: https://codesandbox.io/s/cranky-herschel-36ypx?file=/src/demo/DataTableRowGroupDemo.js

But sorting functionality and similar will most likely break, so you will have to write your own sort methods.

@mertsincan mertsincan added this to the Future milestone Nov 4, 2021
@mertsincan mertsincan self-assigned this Nov 4, 2021
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Nov 4, 2021
@mertsincan
Copy link
Member

mertsincan commented Nov 4, 2021

Hi,

We've added it to our roadmap and will implement it in future releases. Thanks a lot for the feature request!

Best Regards,

@mertsincan mertsincan removed their assignment Nov 4, 2021
@Vitalii-Pidoprygora
Copy link

Vitalii-Pidoprygora commented Jul 27, 2022

I will be very glad when it becomes available. Missing it a lot in my project.

@melloware
Copy link
Member

Duplicate of #619

@melloware melloware marked this as a duplicate of #619 Nov 14, 2022
@melloware melloware removed this from the Future milestone Nov 29, 2022
@VikasKo-Kore
Copy link

How to implement filtering for multiple fields in same column. Suppose in case of a component inside a column containing name, email, phone no, and now we want to filter on the basis of all three things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

6 participants