【发布时间】:2011-08-15 03:18:59
【问题描述】:
如果您使用其中一个 DataGrid 列并将 editable 设置为 true 它可以让您编辑该单元格。这很好,但是如果我想在单元格被编辑后发送一个 ajax 请求怎么办?如何观察活动?
如果重要的话,我在 Dojo 1.5 上。
【问题讨论】:
如果您使用其中一个 DataGrid 列并将 editable 设置为 true 它可以让您编辑该单元格。这很好,但是如果我想在单元格被编辑后发送一个 ajax 请求怎么办?如何观察活动?
如果重要的话,我在 Dojo 1.5 上。
【问题讨论】:
如果您想检查 DataGrid 的事件,那么我建议您检查 dojox.grid._Events。该对象包含许多包含在 DataGrid 中的事件。
这里列出了一些可能适合您需要的活动:
// editing
onStartEdit: function(inCell, inRowIndex){
// summary:
// Event fired when editing is started for a given grid cell
// inCell: Object
// Cell object containing properties of the grid column.
// inRowIndex: Integer
// Index of the grid row
},
onApplyCellEdit: function(inValue, inRowIndex, inFieldIndex){
// summary:
// Event fired when editing is applied for a given grid cell
// inValue: String
// Value from cell editor
// inRowIndex: Integer
// Index of the grid row
// inFieldIndex: Integer
// Index in the grid's data store
},
onCancelEdit: function(inRowIndex){
// summary:
// Event fired when editing is cancelled for a given grid cell
// inRowIndex: Integer
// Index of the grid row
},
onApplyEdit: function(inRowIndex){
// summary:
// Event fired when editing is applied for a given grid row
// inRowIndex: Integer
// Index of the grid row
}
【讨论】:
onApplyCellEdit() 正是我想要的。谢谢!