primereact icon indicating copy to clipboard operation
primereact copied to clipboard

DataTable : filterDisplay="menu" doesn't work

Open thomasorgeval opened this issue 3 years ago • 7 comments

Describe the bug

When I setup my table with filterDisplay="menu" and I do a research, it doesn't work and show me this type of errors:

image

I don't have any problem with the row configuration and I also tried this and it doesn't work https://stackblitz.com/run?file=src%2FApp.js

Reproducer

https://stackblitz.com/run?file=src%2FApp.js

PrimeReact version

9.5.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chromium 114

Steps to reproduce the behavior

  1. Click on the filter icon
  2. Try to research something
  3. Crash happens

Expected behavior

I wanted to research within my table instead of getting an error

thomasorgeval avatar Jun 28 '23 13:06 thomasorgeval

your stackblitz link is not working for me?

melloware avatar Jun 28 '23 14:06 melloware

Oups, I'm sorry, here is a new link for this: https://react-ic9wzf.stackblitz.io/ You can try to fill the filter at the column "name", I took the code from the documentation and changed filterDisplay="row" to filterDisplay="menu"

thomasorgeval avatar Jun 28 '23 17:06 thomasorgeval

Can you paste the raw link and not the running app. I want to see your code.

melloware avatar Jun 28 '23 17:06 melloware

You can't just change menu to row the filters are different.

Row: https://stackblitz.com/edit/react-hna34f?file=src%2FApp.js

Menu: https://stackblitz.com/edit/react-izvac7?file=src%2FApp.js

melloware avatar Jun 28 '23 17:06 melloware

Isn't it possible to use the same filters as for row appareance at all? https://stackblitz.com/edit/react-ic9wzf?file=src%2FApp.js

thomasorgeval avatar Jun 28 '23 17:06 thomasorgeval

I do that here: https://github.com/melloware/quarkus-monorepo/blob/5e94c8d00549bfca0506f9f2ab61e476d83a6646/src/main/webui/src/CrudPage.tsx#L55-L71

You can see my code in action I toggle between row and menu filters.

Demo: https://github.com/melloware/quarkus-monorepo

I let you toggle back and forth between ROW and MENU filters.

image

melloware avatar Jun 28 '23 19:06 melloware

Thank you a lot for your answer! Have a good day

thomasorgeval avatar Jun 29 '23 07:06 thomasorgeval