Kendo UI网格-使用“选择多选框”进行过滤

时间:2018-10-29 07:43:47

标签: kendo-ui telerik kendo-grid kendo-asp.net-mvc

问题是,当我选择多个复选框并对某项进行过滤时,所有选中的复选框都将恢复为正常的所有复选框(未选中)

我的问题是:我可以选中某些复选框并过滤某些内容,而不对选中的行进行任何更改

请检查下面的照片:

  

1-Checked some rows

     

2-{{​​3}}

     

3-filter some rows where contains 'ss'

当我使用kendo ui v.2018时,请参见here my problem, after press ok on filter get rows without checked

请帮助我!! 谢谢你。

1 个答案:

答案 0 :(得分:0)

尝试将网格的 persistSelection 属性设置为 true

$("#grid").kendoGrid({
  columns: [
    { selectable: true, width: "50px" },
    { field: "name" },
    { field: "age" }
  ],
  dataSource: {
    data: [
      { id: 1, name: "Jane Doe", age: 30 },
      { id: 2, name: "John Doe", age: 33},
      { id: 3, name: "Jim Doe", age: 30 },
      { id: 4, name: "Jack Doe", age: 33}
    ],
    schema: {
      model: { id: "id" }
    }
  },
  filterable: true,
  pageable: {
    pageSize: 2
  },
  persistSelection: true
});
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.1017/styles/kendo.material.mobile.min.css" />
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2018.3.1017/js/kendo.all.min.js"></script>
<div id="grid">