![](/img/trans.png)
[英]Kendo ui grid popup editor form template - how to hide some fields on edit and not on add
[英]Kendo UI grid popup edit custom template - Add a multi-select control
我使用自定义弹出式编辑器模板作为网格的编辑弹出式选项:
editable: { mode: "popup",
template: $("#popup_editor").html()
},
<!-- popup editor template -->
<script id="popup_editor" type="text/x-kendo-template">
template
</script>
模板的要求有一些不在网格中的多选控件,用户在这些多选控件中选择的内容的摘要就是确定网格中“摘要”字段的内容。 例如:
(multi-select1)颜色:红色,蓝色,紫色---不是网格中的字段(multi-select2)大小:xs,s ---不是网格中的字段
摘要:color =“ red,blue,purple”; size =“ xs,s” ---网格中显示的字段
问题是:如何在编辑弹出窗口自定义模板中添加多选?
您可以使用列定义为字段指定自定义编辑器功能,即使在弹出式编辑模式下也可以使用。
columns: [ {
field: "name",
editor: function(container, options) {
// create an input element
var select= $("<select/>");
// set its name to the field to which the column is bound ('name' in this case)
select.attr("name", options.field);
select.appendTo(container);
select.kendoMultiSelect({
dataSource: {
data: ["red", "blue"]
}
});
}
} ],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.