向 Kendo 网格的指定列中的所有单元格添加更改事件

Add change event to all cells in specified column of Kendo Grid

我想使用 Kendo UI 向指定列中的所有单元格添加更改事件。类似于:

 this.myGridVariable.table.on("change", "--InsertMyColumnNameHere--", (e) => { this.doStuff(e) });

我认为这有效:

 this.myGridVariable.table.on("change", "[name=ColumnName]", (e) => { this.doStuff(e) });

但它并没有,至少最新的更新没有。

您需要指定您所指的更改事件:

我相信你会想要第二个。您不能将它绑定到单个字段,但它具有 e.field 并且您可以根据其值执行代码。

.DataSource(dataSource => dataSource

下添加 .Events(e => { e.Change("onEdit"); })

onEdit 是一个 javascript 函数。在此函数中添加此代码 --> function onEdit(e) { if (e.action == "itemchange") { doStuff } }