多重选择角本机

Anu*_*rag 1 nativescript angular2-nativescript angular

我需要为我的nativescript角度应用构建一个多项目选择UI元素。似乎没有支持多种选择的nativescript UI组件。关于如何为我的应用程序实现此功能的任何示例?

Hab*_*eeb 5

使用Nativescript UI。列表视图和侧面抽屉是免费的。

http://docs.telerik.com/devtools/nativescript-ui/Controls/Angular/ListView/selection

多项选择 -允许选择多项。RadListView跟踪选择了哪些项目,并通过getSelectedItems()方法公开它们。通过将multipleSelection属性设置为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>
Run Code Online (Sandbox Code Playgroud)

除了UI试用版下载外,还有一个演示示例。玩那个。