如何在slickgrid中获取值更改事件。我在示例中找到了“grid.onclick”,但它猜测它名称显示每次点击网格时它都会起火。
例如,我有一个包含三列的网格,名称,姓氏和选择(复选框)。我希望当用户选择/取消选中(更改复选框的值)复选框时,我会收到通知。
var cols = [
{id:"fname", name:"First Name", field:"fname"},
{id:"lname", name:"Last Name", field:"lname"},
{id: "select", name: "CheckBox",cssClass: "cell-effort-driven", field: "select", formatter: Slick.Formatters.Checkmark, editor: Slick.Editors.Checkbox}
];
var data = [
{fname:"Jimmy", lname:"Page", select: true},
{fname:"Ritchie", lname:"Blackmore", select: false},
{fname:"Michael", lname:"Schenker", select: true}
];
我查看了SlickGrid对象,它有onCellChange事件。它与复选框不兼容。
答案 0 :(得分:3)
您可以按照以下方式实现,
grid.onCellChange.subscribe(function (e, args) { if (args.cell == 3) { // Assuming that your checkbox is 3rd column //Your check box change event } }