如何通过按钮使可选择或不可选择的剑道网格 [英] how do I make selectable or not selectable a kendo grid by a button

查看:79
本文介绍了如何通过按钮使可选择或不可选择的剑道网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格,在网格定义中启用了选择模式

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/

Just toggleClass什么使表可选择:

Just toggleClass what make table selectable :

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

这篇关于如何通过按钮使可选择或不可选择的剑道网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆