multiple select angular nativescript

好久不见. 提交于 2019-12-24 07:25:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!