SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onEditCommitted  event

It will be fired if type Enter or Tab key to escape from the editing cell in cell editor to commit user editing.
 You can also directly call GridBase.commitEditoronEditCellUpdated event may be fired after this event. 

function onEditCommitted (grid: GridBase, index: CellIndex, newValue: *, oldValue: *);
Returns
Void
Parameters
grid - GridBase.
index - CellIndex.
newValue - *.
oldValue - *.
Code -1
    grid.onEditCellUpdated = function (grid, rowIndex, fieldIndex, newValue, oldValue) {
        console.log(oldValue + ' -> ' + newValue);
    };
    // If change the value of another cell within commit event, onEditCellUpdated event will be fired.
    grid.onEditCommitted = function (grid, index, newValue, oldValue) {
        if (index.dataField() == 0) {
            index.getRow().setData(1, newValue + 100);
        }
    }    
See Also
onEditCellUpdated
onEditCanceled
editOptions
Cell Editing Overview
GridBase.commitEditor
EditOptions.checkDiff
EditOptions.checkCellDiff
EditOptions.strictDiff
Examples
Cell Editing
Edit Events
Edit Keys