pasluc74669 pasluc74669 - 7 months ago 35
Javascript Question

how do I make selectable or not selectable a kendo grid by a button

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();
});

Answer

http://jsfiddle.net/Sbb5Z/585/

Just toggleClass what make table selectable :

$('#bouton').on('click',function(){
        $('table').toggleClass('k-selectable');   
});