问题
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();
});
回答1:
http://jsfiddle.net/Sbb5Z/585/
Just toggleClass what make table selectable :
$('#bouton').on('click',function(){
$('table').toggleClass('k-selectable');
});
来源:https://stackoverflow.com/questions/19225487/how-do-i-make-selectable-or-not-selectable-a-kendo-grid-by-a-button