mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00

* 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
18 lines
797 B
TypeScript
18 lines
797 B
TypeScript
import { EventData } from "tns-core-modules/data/observable";
|
|
import { SubMainPageViewModel } from "../sub-main-page-view-model";
|
|
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout";
|
|
import { Page } from "tns-core-modules/ui/page";
|
|
|
|
export function pageLoaded(args: EventData) {
|
|
const page = <Page>args.object;
|
|
const wrapLayout = <WrapLayout>page.getViewById("wrapLayoutWithExamples");
|
|
page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples());
|
|
}
|
|
|
|
export function loadExamples() {
|
|
const examples = new Map<string, string>();
|
|
examples.set("issue_2895", "list-picker/issue_2895");
|
|
examples.set("list-picker", "list-picker/list-picker");
|
|
examples.set("list-picker-json-array", "list-picker/list-picker-json-array");
|
|
return examples;
|
|
} |