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

DataTable > Column: It doesn't show operators dropdown and value input when dynamic column is in-place. #6574

Open
pradipjs opened this issue May 6, 2024 · 3 comments
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@pradipjs
Copy link

pradipjs commented May 6, 2024

Describe the bug

In DataTable component, If column has dynamic field, it doesn't show the filter option in overlay panel (filterDisplay="menu" in datatable.)
If we do not modify the field property, it works.

Reproducer

https://stackblitz.com/edit/qiryzj-py9pqx?file=src%2FApp.jsx

PrimeReact version

10.6.5

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  1. Add data table component with dummy data.
  2. Add column inside the data table, but field property should be dynamic. i.e. change it on button click or on some event, field property changes.
  3. Click on filter icon, it shows overlay panel with just two buttons, "Clear" & "Apply".

Expected behavior

On filter icon, even if field changes, it should show the filter options in overlay panel.

@pradipjs pradipjs added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 6, 2024
@pradipjs
Copy link
Author

pradipjs commented May 6, 2024

Reference Image of issue
image

@Et7f3
Copy link
Contributor

Et7f3 commented Sep 7, 2024

I see that if you have the default value of _filter as true then it doesn't happen:
const [_filter, showFilter] = useState(true); so I suggest you change the initial value to true and you call useEffect(() => {showFilter(false)}, []) so it flip back to no filter.

So their is a bug (Needs triage can be removed). It seems that a value is computed in a effect and never again.

However this seems strange how you want your dynamic columns. In the example it show you just iterate over columns descriptors and it display just fine. Why can't you do like the example ?

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 7, 2024
@melloware
Copy link
Member

melloware commented Sep 7, 2024

Marked as bug @Et7f3 Sound like some hook needs to fire let me know if you figure it out and feel free to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

3 participants