kendo grid 点击选中与取消选中

 

取消选中使用clearSelection()函数,案例如下:

var selectIndex = 0;
$(function () {
$("#ComplaintRegistrationListGrid").on('click', '.k-selectable tr', function () {
var grid = $("#ComplaintRegistrationListGrid").data("kendoGrid");
var data = grid.dataItem(grid.select());
if (selectIndex == data.Index) {
grid.clearSelection();
} else {
selectIndex = data.Index;
}
});
})

posted @ 2018-04-10 14:55  飞刀软件  阅读(449)  评论(0编辑  收藏  举报