PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.
Apache License 2.0
105 stars 65 forks source link

Support binding items to array of objects with a DisplayValue property #14

Closed digitaldoggo closed 8 years ago

digitaldoggo commented 8 years ago

This would support the use of an array of objects to be used for the drop down. While still only displaying a single string value for the widget, the selected index could be used to identify an object in the array.

This is also backward compatible, so existing code that uses this plugin should not break.

PeterStaev commented 8 years ago

Hey @k3yb0ardn1nja , thanks for your contribution but sadly hardcoding DisplayValue is not a good approach. Take a look at https://github.com/PeterStaev/NativeScript-Drop-Down/issues/2#issuecomment-164700045. Here I showed a generic way how to work with both text and value in the drop down.

digitaldoggo commented 8 years ago

@PeterStaev Perfect. Thanks for guidance! Sorry for not investigating further before the pull request.