PeterStaev / NativeScript-Drop-Down

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

Customize ValueList object with custom key/value #154

Closed relez closed 6 years ago

relez commented 6 years ago

Hey there, we have an existing API that is working with current apps and we use ID/Description as key/value pair, is there any way to customize the ValueList object key/value?

Thanks!

PeterStaev commented 6 years ago

Hey @relvis , there is no customization but it is not needed as you can simply remap them in TS/JS.

relez commented 6 years ago

For documentation purposes should look like this, correct me if I am wrong @PeterStaev:

var mappedItems = originalArray.map(item => ({
   display: item.Description,
    value: item.ID
}));

Thanks!