【发布时间】:2019-01-19 18:13:23
【问题描述】:
我正在尝试动态更改 Nativescript Angular App 的 RadListView Ui 列表中 itemReorder 布尔值的值,但没有成功。每次出现此错误:行为未附加到 RadListView,请使用 RadListView addbehavior 方法附加它。
HTML:
<GridLayout tkExampleTitle tkToggleNavButton class="proposedLettersRow">
<RadListView #itemReord [items]="items" selectionBehavior="LongPress" reorderMode = "Drag" [itemReorder]="itemReorder" (itemReordered)="onItemReordered($event)" multipleSelection= "false"
>
<ng-template tkListItemTemplate let-item="item">
<GridLayout class="listItemTemplateGrid" >
<Label
[text]="item"
[ngClass]="!isWin ? 'proposed' : 'proposedIsDone'"
class="list-group-item ">
</Label>
</GridLayout>
</ng-template>
<ListViewGridLayout tkListViewLayout
scrollDirection="Vertical"
height="150"
ios:itemHeight="150"
spanCount="7"
horizontalAlignment="center">
</ListViewGridLayout>
</RadListView>
</GridLayout>
打字稿:
一开始this.itemReorder设置为true,然后一个函数来将其更改为false,执行此函数时出现错误。
【问题讨论】:
-
您能否在文本中添加代码,而不是通过问题中的图像。
-
我已经编辑添加这个
-
我无法重现该问题,让我们知道您是否可以使用您的代码更新此Playground。
-
Playground 更新,代码重现问题:play.nativescript.org/?template=play-ng&id=EjIK8s&v=2@Manoj
-
向上拖动一个元素会导致 App @Manoj 崩溃
标签: angular nativescript radlistview