You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] 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
Current behavior
Currently when using a p-dropdown the entire object being selected must be bound to ngModel or formControl.
Expected behavior
I would like the ability to bind to the dataKey property. e.g. if my dataKey is "id" and I have bound an ngModel or formControl to the p-dropdown I would like the ability to bind to the "id" property from the selected object instead of the full object. Perhaps this could be accomplish with some sort of [bindToDataKey] boolean property or something like that.
The text was updated successfully, but these errors were encountered:
USLSRV
changed the title
A
Allow binding to dataKey for p-dropdown instead of entire object
May 17, 2019
I found a little dirty solution to this, after spending hours and hours researching and debugging:
First import SelectItem from primeng import { SelectItem } from 'primeng/components/common/selectitem';
Then create your options-Object for the dropdown in you component.ts:
I'm submitting a ... (check one with "x")
Current behavior
Currently when using a p-dropdown the entire object being selected must be bound to ngModel or formControl.
Expected behavior
I would like the ability to bind to the dataKey property. e.g. if my dataKey is "id" and I have bound an ngModel or formControl to the p-dropdown I would like the ability to bind to the "id" property from the selected object instead of the full object. Perhaps this could be accomplish with some sort of [bindToDataKey] boolean property or something like that.
The text was updated successfully, but these errors were encountered: