SMART datagrid v1.4 > Classes > EditOptions

[ grids ver.1.3.0]   Back  Forward

DataLudi.EditOptions.autoCommit  property

true로 지정하면 그리드에서 행 수정일 때, DataSet을 변경하는 함수를 호출하면 자동으로 먼저 그리드행 편집을 commit한다. 

그리드 행을 수정/추가 중일 때 이벤트 핸들러 등에서 DataSet을 변경하는 함수를 호출하면 "Client is editing" 예외가 발생한다. 이 예외를 피하기 위해서는 먼저 행 편집을 완료해야 한다. 이 속성을 true로 설정하면 그리드가 자동으로 커밋한다. 

행 편집 중 같은 행의 셀 값을 변경할 때는 GridDataSet.setValue 대신, GridBase.setValueAt 등을 호출해야 한다. 

기본값은 false.

Getter
function autoCommit(): Boolean
Setter
function setAutoCommit(value: Boolean)
Code -1
    grid.setOptions({
        edit: {
            autoCommit: true
        }
        ...
    });
Code -2
    grid.setEditOptions({
        autoCommit: true
    });
Code -3
    grid.editOptions().setAutoCommit(true);
Code -4
    grid.onEditCellUpdated = function (grid, row, fieldIndex, newValue, oldValue) {
        // autoCommit이면, 이 호출 전에 그리드 편집이 먼저 완료된다.
        dataset.updateRow(9, { 'salary': dsMain.getValue(9, 0) + 1 });
    };
See Also
GridBase.isRowEditing
GridBase.commit
GridBase.cancel
GridDataSet.setValue
GridBase.setValueAt
GridBase.setCellValue
Examples
Cell Editing