开发者

How can I observe the event of a DataGrid's cell being edited?

If you take one of your DataGrid columns and set editable to true it lets you edit that cell. That's great, but what if I want to send an ajax request after the cell gets edited? How can I observe the event?

I'm on Dojo 1.5开发者_运维知识库 if it matters.


If you want to examine the Events for a DataGrid then I would recommend checking dojox.grid._Events. That object contains a lot of events that is included in DataGrid.

Here is a list of a few Events that might suite your need:

// 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
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜