Primeng: custom list of objects to dropdown

Created on 15 May 2016  路  7Comments  路  Source: primefaces/primeng

dropdown gets only array of objects that has two properties:
{label: 'Audi', value: 'Audi'} as strings. otherwise either you get exception Cannot read property 'label' of undefined if has'nt got label property, or the ngmodel wont change if the value property is an object

It would be great if the developer will be able to fill the dropdown with custom objects and a property to show to the user. something like value in data table and field in column.

defect

Most helpful comment

Fixed for beta10.

All 7 comments

https://github.com/primefaces/primeng/pull/370 should give you that feature if and when it's merged :)

@brtnshrdr thx!

do you know if they're going to do this feature?

No idea! But I made a pull request so we can only wait and see!

The same problem:

Template:

<p-dropdown [options]="item.rates">
            <template let-element>
              <li style="position: relative">
                <div>111111</div>
              </li>
            </template>
</p-dropdown>

Error:
Error

Fixed for beta10.

Can you give some working example? I updated to beta.11 and still got this error...

"fieldLabel" is not in the current master branch available, as far as i could see there have been a merge conflict which moved that fix out again?
@cagataycivici am i right?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gatapia picture gatapia  路  3Comments

miresk picture miresk  路  3Comments

Helayxa picture Helayxa  路  3Comments

garethlewis picture garethlewis  路  3Comments

markgoho picture markgoho  路  3Comments