2017-03-11 11 views
0

私は、ナンバースクリプト角度アプリのために複数の項目を選択するUI要素を作成する必要があります。複数の選択をサポートするnativescript UIコンポーネントはないようです。どのように私は私のアプリのためにこれを実装できるかの例?複数の選択角度のネイティブスクリプト

答えて

3

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> 

デモサンプルがあります。それで遊ぶ。

+0

ありがとう、コンポーネントは仕事をします! – Anurag

関連する問題