SMART datagrid v1.4 > Classes > GridBase

Back  Forward

DataLudi.GridBase.onEditCommitted  event

셀 편집기에서 Enter 키를 입력하거나, Tab 키 등으로 편집 중인 셀을 벗어나서 사용자 편집이 완료될 때 발생한다.
 GridBase.commitEditor를 직접 호출할 수도 있다. 이 이벤트 후 onEditCellUpdated 이벤트가 발생할 수 있다. 

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);
    };
    // commit 이벤트 내에서 다른 셀의 값을 변경하면 onEditCellUpdated 이벤트가 발생한다.
    grid.onEditCommitted = function (grid, index, newValue, oldValue) {
        if (index.dataField() == 0) {
            index.getRow().setData(1, newValue + 100);
        }
    }    
See Also
onEditCellUpdated
onEditCanceled
editOptions
셀 편집 개요
GridBase.commitEditor
EditOptions.checkDiff
EditOptions.checkCellDiff
EditOptions.strictDiff
Examples
셀 편집
Edit Events
Edit Keys