2

我正在为网格的编辑弹出选项使用自定义弹出编辑器模板:

editable: { mode: "popup",
    template: $("#popup_editor").html()
      },

<!-- popup editor template -->
    <script id="popup_editor" type="text/x-kendo-template">
            template
            </script>

要求模板有一些不在网格中的多选控件,用户在这些多选控件中选择的内容的摘要决定了网格中的“摘要”字段。前任:

(多选1)颜色:红色,蓝色,紫色---不是网格中的字段(多选2)大小:xs,s---不是网格中的字段

摘要: color="红、蓝、紫" ; size="xs, s" --- 网格中显示的字段

问题是:如何在编辑弹出自定义模板中添加多选?

4

1 回答 1

1

您可以使用列定义为字段指定自定义编辑器功能,即使在弹出编辑模式下也可以使用。

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"]
       }    
     });
    }
  } ],
于 2013-09-16T06:41:32.747 回答