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

PrimereactDatatable: Get current table filters #6501

Closed
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@Amit-ga
Copy link

Amit-ga commented Apr 30, 2024

Describe the bug

Hello,
I am trying to allow the user data filtering via URL in primereact datatable.
I am working on a URL generator button that shows a popup with the URL that matches the current selected filters.

I opened this enhancement request and was told to open an issue:
[(https://github.com/orgs/primefaces/discussions/1366
)]

Please allow getting the current selected filters from the table at any given time.
Thank you.

Reproducer

No response

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

chrome, edge

Steps to reproduce the behavior

No response

Expected behavior

No response

@Amit-ga Amit-ga added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 30, 2024
@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 30, 2024

Can you provide a stackblitz link please ?

@sja-cslab
Copy link
Contributor

sja-cslab commented Apr 30, 2024

@Rekl0w that should be a Feature Request. OPs question from the discussion is:

How can i get the current selected filters from the table at any given time? after clicking apply in a filter menu, where does it get updated?

It's not possible atm correct?

So reproducer would be PrimeReact Doc Advanced Filter

@melloware
Copy link
Member

Yes I think we need to expose the current filters in the ImperativeHandle i will submit a PR.

@melloware melloware added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 30, 2024
@melloware melloware self-assigned this Apr 30, 2024
melloware added a commit to melloware/primereact that referenced this issue May 1, 2024
melloware added a commit to melloware/primereact that referenced this issue May 1, 2024
@melloware melloware added this to the 10.7.0 milestone May 1, 2024
@melloware
Copy link
Member

PR submitted to expose current Filter and Sorts in the ref.

@faelperetta
Copy link

faelperetta commented Jun 24, 2024

@melloware when setFilterMeta is called, isn't it supposed to trigger onValueChange event in the DataTable? I'm using setFilterMeta and I was expecting this data change event to be triggered but it is not.

@melloware
Copy link
Member

@faelperetta check the code and see what its doing. I just exposed those methods to the external interface didn't change their behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment