【问题标题】:How can I observe the event of a DataGrid's cell being edited?如何观察 DataGrid 的单元格被编辑的事件?
【发布时间】:2011-08-15 03:18:59
【问题描述】:

如果您使用其中一个 DataGrid 列并将 editable 设置为 true 它可以让您编辑该单元格。这很好,但是如果我想在单元格被编辑后发送一个 ajax 请求怎么办?如何观察活动?

如果重要的话,我在 Dojo 1.5 上。

【问题讨论】:

    标签: datagrid dojo


    【解决方案1】:

    如果您想检查 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() 正是我想要的。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2011-11-27
    • 1970-01-01
    • 1970-01-01
    • 2011-10-09
    • 1970-01-01
    • 1970-01-01
    • 2015-09-10
    • 1970-01-01
    相关资源
    最近更新 更多