3
如何设置Kendo网格弹出编辑对话框的密码输入字段以显示密码,例如...? 请帮忙。如何在Kendo UI Grid中为弹出编辑设置密码模式
如何设置Kendo网格弹出编辑对话框的密码输入字段以显示密码,例如...? 请帮忙。如何在Kendo UI Grid中为弹出编辑设置密码模式
添加editor
功能的column
定义如下:
editor: function (container, options) {
$('<input data-text-field="' + options.field + '" ' +
'class="k-input k-textbox" ' +
'type="password" ' +
'data-value-field="' + options.field + '" ' +
'data-bind="value:' + options.field + '"/>')
.appendTo(container)
}
你甚至可以隐藏使用columns.hidden
列,而不是在编辑模式下这样做的:
{
hidden: true,
field : "password",
title : "Password",
editor: function (container, options) {
$('<input data-text-field="' + options.field + '" ' +
'class="k-input k-textbox" ' +
'type="password" ' +
'data-value-field="' + options.field + '" ' +
'data-bind="value:' + options.field + '"/>')
.appendTo(container)
}
} ,
我会做一点点不同(对于Popup编辑器)。在构建html之后添加属性。
编辑: 我已经添加了如何添加工具提示的示例。
$(“#grid”).kendoGrid(
{
…,
edit: function(e)
{
//Add password attribute to input field.
e.container.find(“.k-edit-field:eq(1) > input”).attr(‘type’, ‘password’);
//Add tooltip.
e.container.find("[data-label-for = name], [data-container-for = name]").attr('title', "One and two"));
}
}
这是完美的工作!谢谢! – ronin1184 2013-03-22 02:20:18