I have a grid, with the selection mode enabled, in the grid definition
selectable: true
I need to make the grid not selectable, by a button. I tried this, but it isn't working:
$("#disableKendoGrid").click(function () {
var grid = $("#myGrid").data("kendoGrid");
grid.options.selectable = false;
grid.refresh();
});
Description. There are situations when you would like to enable the end user to select rows or cells in the grid table, and process data from them or make calculations based on this selection. The Kendo UI grid supports selection by specifying its configuration via its selectable attribute.
Solution. When selection is enabled in the Grid component, the built-in option for deselecting a row or selecting multiple rows is Ctrl + click.
http://jsfiddle.net/Sbb5Z/585/
Just toggleClass what make table selectable :
$('#bouton').on('click',function(){
$('table').toggleClass('k-selectable');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With