1
如果您將其中一個DataGrid列設置爲editable
並將其設置爲true
,則可以編輯該單元格。這很好,但如果我想在單元格被編輯後發送ajax請求呢?我如何觀察事件?如何觀察正在編輯的DataGrid單元格的事件?
如果它很重要,我在Dojo 1.5上。
如果您將其中一個DataGrid列設置爲editable
並將其設置爲true
,則可以編輯該單元格。這很好,但如果我想在單元格被編輯後發送ajax請求呢?我如何觀察事件?如何觀察正在編輯的DataGrid單元格的事件?
如果它很重要,我在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()'這正是我想要的。謝謝! – 2011-04-29 22:57:13