javascript - Angular - 将点击事件添加到剑道下拉列表项模板
问题描述
<kendo-dropdownlist [formControl]="formGroup?.get('userIdNew')" textField="id" valueField="id"
[valuePrimitive]="true" id="userName" [data]="users$ | async">
<ng-template kendoDropDownListValueTemplate let-dataItem>
<app-tft-user-name [id]="dataItem?.id" [users]="users$ | async"></app-tft-user-name>
</ng-template>
<ng-template kendoDropDownListItemTemplate let-dataItem>
<app-tft-user-name [id]="dataItem?.id" [users]="users$ | async"></app-tft-user-name>
</ng-template>
<ng-template kendoDropDownListFooterTemplate>
<button class="justify-content-center" icon="plus" kendoButton look="clear"
(click)="dispatchNewUser()">
{{ 'STATUS-TABLE.ADD-USER' | translate }}
</button>
</ng-template>
</kendo-dropdownlist>
当用户从剑道下拉列表中选择一个新值时,我试图触发一个对话框。我尝试在下拉列表中使用 (change)="foo()" ,但我不希望它在用户选择添加新用户时触发,只有当他们从列表中选择现有用户时才会触发。有什么建议么?谢谢!
解决方案
推荐阅读
- docker - 在 centos 中创建 Docker 映像失败
- javascript - 在ajax调用成功后复制到剪贴板,在Chrome中有效,但在Firefox中无效
- database - 如何在 Laravel 数据库中获取所有国家与城市和州
- angular - 如何在 Angular 6 中编辑环境变量而不重建?
- sql - 引用表中没有与外键中的列列表匹配的主键或候选键
- javascript - document.execCommand("copy") 不适用于所有浏览器
- eclipselink - EclipseLink Moxy 与 Java11
- react-native - 如何在 React-native 中调用 Field 渲染方法之外的函数?
- monitoring - Grafana/Graphite 将 y 轴标签更改为折线图的 %
- vb.net - 为什么我没有将对象引用设置为 Google Drive Api 中的对象实例?