多选角本机脚本 [英] multiple select angular nativescript
问题描述
我需要为我的 nativescript angular 应用程序构建一个多项目选择 UI 元素.似乎没有支持多选的 nativescript UI 组件.关于如何为我的应用实现此功能的任何示例?
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?
推荐答案
使用 Nativescript UI.列表视图和侧边抽屉是免费的.
Use Nativescript UI. List view and side drawer is free.
http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/ListView/selection
多选 - 允许选择多个项目.RadListView 跟踪选择了哪些项目,并通过 getSelectedItems() 方法公开它们.通过将 multipleSelection 属性设置为 true 来启用多选.
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>
除了 UI 试用版下载外,还有一个演示示例.玩那个.
Along with UI trial download, There is a demo sample. Play with that.
这篇关于多选角本机脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!