我同时使用Kendo网格onchange事件和Select功能,但是当我单击任何复选框时,都会调用行单击事件。我也在使用服务器端分页。我的列结构来自数据库json。 代码是:
$("#grid").kendoGrid({
dataSource: sharedDataSource,
pageable: {
refresh: true,
pageSizes: [5, 10, 15, 20, 50, 100, 200],
input: true,
buttonCount: 5
},
sortable: true,
resizable: true,
columnMenu: true,
reorderable: true,
columnResizeHandleWidth: 6,
change: onChange,
filterable: true,
selectable: true,
scrollable: true,
dataBound: function (e) {
persistSelection();
},
noRecords: {
template: "No data found for this search"
},
columns: myColumns
}).data("kendoGrid");
}
和JSON列为
{
"selectable": true,
"template": "<input type=\"checkbox\" style=\"margin-left: 4px;\" class=\"checkone\" id=\"#= Id #\">",
"width": 50
},
{
"encoded": true,
"field": "FirstName",
"title": "First Name",
"width": 200
}
}