SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onEditCellUpdated  event

セルエディターでEnterキーを入力するか、Tabキーなどで編集中であるセルから抜けてユーザーの編集が完了になり、 onEditCommittedイベントが発生した後、編集した行がセーブされた後に発生する。 編集中の行のデータセルにctrl+vでクリップボードからの貼り付けを実行して値が変わる時にも発生する。 また、ユーザーの動作以外にGridRow.setDataを呼び出して編集中である行のセルの値を変更すれば同じように発生することができる。 グリッドeditOptionscheckDiffcheckCellDiffstrictDiffの設定によって 編集の値が無視され、それによりイベントが発生しないこともある。 

function onEditCellUpdated (grid: GridBase, row: GridRow, fieldIndex: Integer, newValue: *, oldValue: *);
Returns
Void
Parameters
grid - GridBase.
row - GridRow.
fieldIndex - Integer.
newValue - *.
oldValue - *.
Code -1
    grid.onEditCellUpdated = function (grid, rowIndex, fieldIndex, newValue, oldValue) {
        console.log(oldValue + ' -> ' + newValue);
    };
    grid.onEditCommitted = function (grid, index, newValue, oldValue) {
        if (index.dataField() == 0) {
            index.getRow().setData(1, newValue + 100);
        }
    }
See Also
onEditCommitted
onEditCanceled
editOptions
GridBase.commitEditor
EditOptions.checkDiff
EditOptions.checkCellDiff
EditOptions.strictDiff
Examples
セル編集