Prevent Selection for Checkbox Cells
Environment
Product | Progress® Kendo UI® Grid for jQuery |
Operating System | All |
Browser | All |
Browser Version | All |
Description
How can I prevent selection for checkbox cells in the Kendo UI Grid for jQuery?
Solution
The following example demonstrates how to prevent the cell-selection functionality for a checkbox or any cell.
<div id="grid"></div>
<script>
$(function() {
var grid = $("#grid").kendoGrid({
dataSource: {
data: [{foo:1}, {foo:2}]
},
columns: [
{
template: '<input type="checkbox" />'
},
"foo"
],
selectable: "multiple cell"
}).on(kendo.support.pointers ? "pointerup" : "mouseup", ".k-grid-content tr > td:first-child", function () {
grid.selectable.one("select", function(e) {
e.preventDefault();
});
}).data("kendoGrid");
});
</script>