Files
NativeScript/apps/app/ui-tests-app/list-picker/list-picker-json-array.xml
Sebastian Witalec 9e2e8ec3a1 feat(list-picker): add textField, valueField and selectedValue properties (#6033)
* Added textField, valueField and selectedValue properties

textField and valueField - should be used with arrays of JSON objects
textField - tells the listview which property should be used to display each item
valueField - tells the listview, which property should be used to update the selectedValue
selectedValue - is the property that will contain the selectedValue, if valueField is specified, then it will contain the value from that field, otherwise it will contain the whole selected item

* Example showing textField, valueField and selectedValue in action

* Update import paths
2018-07-23 17:06:01 +03:00

11 lines
372 B
XML

<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<StackLayout class="p-20">
<ListPicker items="{{ items }}"
textField="name"
valueField="role"
selectedIndex="2"
selectedValue="{{ selectedItem }}">
</ListPicker>
<Label text="{{ selectedItem }}" textWrap="true" />
</StackLayout>
</Page>