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

喜你入骨 提交于 2019-12-12 11:11:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!