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

Multi filter support for Dropdown #2454

Closed
xuanshenbo opened this issue Apr 5, 2017 · 3 comments
Closed

Multi filter support for Dropdown #2454

xuanshenbo opened this issue Apr 5, 2017 · 3 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@xuanshenbo
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)

Current behavior

In a dropdown list with a filter, it only filters items' label, but not their value.
For example, I have:

reasons = [];
reasons.push(label: '1910', value: {reason: 'Date not valid', severity: 'Warning'});

When I type 'Date ...' in the search box, no results will be returned.
Expected behavior

User would be able to search with both label and value that's being displayed.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

One item can have not only its label but may also have some of its corresponding values. Think of the Content with Filters example on PrimeNG website, imagine the logos are some ids of the car brands, together with the brand name. Users would expect to be able to search everything that is being displayed. But in fact users are only able to search the brand names, but not the ids.
Please tell us about your environment:

  • Angular version: 2.0.X
  • PrimeNG version: 2.0.X

primeng 2.0.2

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

@pcavacas
Copy link

pcavacas commented Apr 15, 2017

I created pull request #2530 that implements this functionality. It adds a new property to the dropdown component called filterOnId which is a boolean property. If this is not present or set to false then everything works as it does today. If this is set to true then when you filter it will filter on the label and also the stringfied version of the value property, i.e. the following test both work
this.cars.push({label: 'Audi', value: 'BMW'});
this.cars.push({label: 'Audi', value: {value: 'BMW'}});

@cagataycivici cagataycivici changed the title [Feat] [Dropdown] Filter should not only filter the labels, but also the values that are being displayed Multi filter support for Dropdown Jun 6, 2017
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Jun 6, 2017
@cagataycivici cagataycivici added this to the 4.1.RC1 milestone Jun 6, 2017
@cagataycivici
Copy link
Member

@Mrtcndkn Introduce filterBy="field1, field2.subfield" please to customize it.

@Mrtcndkn
Copy link
Contributor

Mrtcndkn commented Jun 6, 2017

@cagataycivici @xuanshenbo It's in progress.

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

4 participants