问题
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