Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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();
});
like image 315
pasluc74669 Avatar asked Oct 07 '13 12:10

pasluc74669


People also ask

What is selectable in kendo grid?

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.

How do I deselect a row in kendo grid?

Solution. When selection is enabled in the Grid component, the built-in option for deselecting a row or selecting multiple rows is Ctrl + click.


1 Answers

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

Just toggleClass what make table selectable :

$('#bouton').on('click',function(){
        $('table').toggleClass('k-selectable');   
});
like image 172
BENARD Patrick Avatar answered Oct 20 '22 01:10

BENARD Patrick