Hello,
The requirement is as follows: just as the file attached below, the black item can't delete, while the green item can delete. I try to achieve it by the code below:
But the last two templates don't seem to work. Can you help me ?
<GridLayout rows="auto,*" columns="*" dock="right" backgroundColor="#ffffff">
<StackLayout row="0" col="0">
<Button class="btn btn-primary addButton" text="新增子类别" (tap)="displayInput()"></Button>
</StackLayout>
<RadListView class="list-group" row="1" id="listView" [items]="detailList" itemSwipe="true" (itemSwipeProgressChanged)="onItemSwipeProgressStarted($event)"
(itemSwipeProgressEnded)="onSwipeCellFinished($event)">
<template tkListItemTemplate class="list-detail" let-item="item">
<StackLayout class="list-group-item">
<GridLayout columns="*" rows="auto" (tap)="onItemTap(item)" width="60%">
<Label *ngIf="!item.isInit" class="m-l-30 h4 list-group-item-text-primary text-left" [text]="item.name"></Label>
<Label *ngIf="item.isInit" class="m-l-30 h4 list-group-item-text text-left" [text]="item.name"></Label>
</GridLayout>
<StackLayout class="m-t-20" height="1" backgroundColor="#F7F7F7"></StackLayout>
</StackLayout>
</template>
<template ngFor let-item [ngForOf]="detailList">
<template [ngIf]="!item.isInit">
<GridLayout *tkListItemSwipeTemplate columns=" *, auto" class="listItemLeftSwipeGridLayout" (tap)="onRightSwipeClick($event)">
<GridLayout *ngIf="!item.isInit" id="delete-view" class="deleteViewStackLayout" col="1">
<Label [text]="'fa-trash' | fonticon" class="fa"></Label>
</GridLayout>
</GridLayout>
</template>
</template>
</RadListView>
</GridLayout>