剑道网格列可过滤模式:“行”和“菜单”

Eff*_*ges 3 kendo-grid

对于 Kendo UI Grid,可以选择将可过滤设置为行或菜单或两者。我想知道是否可以将某些列设置为行(仅作为行),而其他列显示为菜单(仅作为菜单)。最好不要用css。

示例:我希望字段名称是行过滤器,而年龄是菜单过滤器

<script>
      $("#grid").kendoGrid({
  dataSource: ...
  filterable: { 
    operators: {
      string: {
        startswith: "Starts with",
        eq: "Exact Client Name",
        contains: "contains"
      },
      number: {
        gte: "From",
        lte: "Before"
    }
   },
   mode: "row" },
   column: [ { field: "ClientName", title: "Client Name", width: 150, type: "string" , attributes: { style: "text-align:left;" }, filterable: { messages: { info: "Show clients that: " }, extra: false} },
             { field: "Month", title: "Month", width: 78, type: "number", attributes: { style: "text-align:center;" }, filterable: { messages: { info: "Show month(s): ", and: "To" }, ui: monthFilter, mode: "menu" } }
   ]
 });
</script>
Run Code Online (Sandbox Code Playgroud)

Eff*_*ges 6

我想出了一个解决方案。可能不是最好的解决方案,但对于需要它以供将来参考的任何人,我使用了以下解决方案。将可过滤模式设置为 模式:“行,菜单”

   filterable: {
      cell: { enabled: false}   
    }
Run Code Online (Sandbox Code Playgroud)

消除不需要的行过滤器。并使用 jquery

databinding: function(e){
     $("#grid-name .k-grid-filter .k-filter").css('display', 'none');
     $("#grid-name ").find("[data-field=Month]>.k-grid-filter .k-filter").css('display', 'block');
}
Run Code Online (Sandbox Code Playgroud)

消除不需要的列菜单过滤器。