问题
I need to build a multiple item select UI element for my nativescript angular app. There does not seem to be a nativescript UI component supporting multiple selection. Any examples of how I could implement this for my app?
回答1:
Use Nativescript UI. List view and side drawer is free.
http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/ListView/selection
multiple selection - allows for selecting multiple items. RadListView keeps track of which items are selected and exposes them through a getSelectedItems() method. Multiple selection is enabled by setting the multipleSelection property to true.
<RadListView [items]="dataItems" selectionBehavior="Press" multipleSelection="true">
<!-- << angular-listview-item-selection-multiple -->
<template tkListItemTemplate let-item="item">
<StackLayout class="listItemStackLayout">
<Label class="nameLabel" [text]="item.name"></Label>
<Label class="descriptionLabel" [text]="item.description"></Label>
</StackLayout>
</template>
<ListViewLinearLayout tkListViewLayout itemHeight="50" scrollDirection="Vertical"></ListViewLinearLayout>
</RadListView>
Along with UI trial download, There is a demo sample. Play with that.
来源:https://stackoverflow.com/questions/42731622/multiple-select-angular-nativescript