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

MultiSelect not working when Objects contain property "value" #9561

Closed
Timmeeeey opened this issue Nov 23, 2020 · 3 comments
Closed

MultiSelect not working when Objects contain property "value" #9561

Timmeeeey opened this issue Nov 23, 2020 · 3 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Timmeeeey
Copy link

I'm submitting a ...

[x] bug report
[ ] feature request
[ ] support request

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/primeng-multiselect-demo-xda4gx

Current behavior
If you select options which have a property "value" they are not marked as checked.

this.cities = [
      { name: "New York", value: "NY" },
      { name: "Rome", value: "RM" },
      { name: "London", value: "LDN" },
      { name: "Istanbul", value: "IST" },
      { name: "Paris", value: "PRS" }
    ];

image

  • Angular version: 11.X

  • PrimeNG version: 11.X

@jimmycartrette
Copy link

Seconded, I have to change my SelectItems to a custom {mylabel:string;myvalue:string} with multi-select option optionLabel="mylabel". The filter function returns the value in a format option1,option2 when using selectitem in multiselect

@yigitfindikli yigitfindikli self-assigned this Nov 25, 2020
@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 25, 2020
@yigitfindikli yigitfindikli added this to the 11.0.0-rc.2 milestone Nov 25, 2020
@ODB-Gideon
Copy link

ODB-Gideon commented Nov 25, 2020

Hi, same issue for me. I am using multiselect with table for filtering a single column. The filtering works but the checkboxes are not shown as selected.

I am using optionalLabel = "name" and optionValue="myVal"

The object interface looks like:
{ name: string; myVal: el.string}

I have tried combinations of adding label and value keys to the object and removing optionLabel and optionValue from the html and no combination works entirely.

I have however noticed:

  1. Setting optionValue or placing a value key in the object results in the filter working but the checkboxes not showing
  2. Removing optionValue and removing a value key in the object results in the checkboxes showing but the filter not working.

Thank you for your time!

@incode4it
Copy link

HI. I'm having the same issue

@yigitfindikli yigitfindikli added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Discussion Issue or pull request needs to be discussed by Core Team and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Nov 30, 2020
@cagataycivici cagataycivici removed the Status: Discussion Issue or pull request needs to be discussed by Core Team label Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

6 participants