SMART datagrid v.1 > Classes > EditOptions

[ grids ver.1.3.0]   Back  Forward

DataLudi.EditOptions.autoCommit  property

If specify as true, when Row Updating in grid, if call the function which changes DataSet, it will automatically commit grid row editing first. 

When updating or appending grid rows, if call the function which changes DataSet in event handler, it will throw "Client is editing" exception. In order to avoid this exception, row editing should be committed first. If set this property as true, the grid will automatically commit. 

When change the cell value of the same row during row editing, you should call GridBase.setValueAt instead of GridDataSet.setValue

Defaults to 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) {
        // If it is autoCommit, it will commit grid editing first before this call.
        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