【问题标题】:Angular KendoUI Grid Conditional Password FieldAngular Kendo UI 网格条件密码字段
【发布时间】:2019-07-26 19:07:34
【问题描述】:

我有一个带有编辑功能的 KendoUI Grid,用于处理配置参数,其中一些是加密密码。网格的The editor property 不允许密码类型字段,并且我无法在该列密码类型上进行所有编辑字段,因为并非所有字段都如此,因此该对象具有我想要的属性encrypted在自定义 ng-template 中使用以更改输入类型。

如何才能使编辑字段仅在encrypted 属性为true 时才变为type="password"

<ng-template kendoGridEditTemplate let-column="column" let-formGroup="formGroup" let-isNew="isNew">
    <input class="k-input" #valueInput [formControl]="formGroup.get(column.field)" />
</ng-template>

【问题讨论】:

    标签: angular kendo-ui kendo-ui-angular2 kendo-ui-grid


    【解决方案1】:

    您正在寻找的是属性绑定。

     <input class="k-input" [type]="encrypted ? 'password' : 'text'" #valueInput [formControl]="formGroup.get(column.field)" />
    

    【讨论】:

    • 加密似乎不在生成的输入范围内,或者至少不像您的示例那样明显可用。
    • 我一定是误会了。你的对象在哪里被引用encrypted 属性?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-16
    • 2018-06-23
    • 1970-01-01
    • 1970-01-01
    • 2015-05-21
    相关资源
    最近更新 更多