本文介绍了如何通过按钮使剑道网格可选择或不可选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网格,在网格定义中启用了选择模式
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();
});
推荐答案
http://jsfiddle.net/Sbb5Z/585/
只需toggleClass什么使表可选:
Just toggleClass what make table selectable :
$('#bouton').on('click',function(){
$('table').toggleClass('k-selectable');
});
这篇关于如何通过按钮使剑道网格可选择或不可选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!