SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onEditCellUpdated  event

If type Enter or Tab key to escape from the editing cell in cell editor to commit user editing, onEditCommitted event will be fired, and this event will be fired after the edited value is stored in editing row buffer. 

It can also be fired when run clipboard pasting by ctrl+v in the data cell of editing row to change the value. And, it can also be fired if call GridRow.setValue besides user operation to directly change the value of cell in editing row and actually change it to another value. In the case of user input, editing value can be ignored according to checkCellDiff, strictDiff settings of grid editOptions and therefore, an event may not be fired. 

function onEditCellUpdated (grid: GridBase, row: GridRow, fieldIndex: Integer, newValue: *, oldValue: *);
Returns
Void
Parameters
grid - GridBase.
row - GridRow.
Grid Row which is edited now.
fieldIndex - Integer.
The index of DataField which is connected to the column of cell which is edited now.
newValue - *.
The new value which has been edited.
oldValue - *.
The value before editing.
Note
Code -1
    grid.onEditCellUpdated = function (grid, row, fieldIndex, newValue, oldValue) {
        console.log(oldValue + ' -> ' + newValue);
    };
    // If change the value of other cell within commit event, onEditCellUpdated event will be fired.
    grid.onEditCommitted = function (grid, index, newValue, oldValue) {
        if (index.dataField() == 0) {
            index.getRow().setValue(1, newValue + 100);
        }
    }
See Also
onEditCommitted
onEditCanceled
editOptions
Cell Editing Overview
GridBase.commitEditor
EditOptions.checkCellDiff
EditOptions.strictDiff
Examples
Cell Editing
Edit Events
Edit Keys