Kendo UI Grid - Filter with Select Multi-Checkbox

纵饮孤独 提交于 2019-12-11 17:51:52

问题


Problem is that when I choose multiple checkbox and filter for something all checkbox selected returns to normal all checkbox's (un-checked)

my question is : Can I do the checked some checkbox's and filter for something without do any changes on my rows checked

please check photos in below :

1 - Checked some rows

2 - filter some rows where contains 'ss'

3 - here my problem, after press ok on filter get rows without checked

when i'm using kendo ui v.2018 see image

please help me!! Thanks UW.


回答1:


Try setting the persistSelection property of your grid to 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">


来源:https://stackoverflow.com/questions/53040890/kendo-ui-grid-filter-with-select-multi-checkbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!