SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.canUpdateValue  method

If field value of data row in row location is updatable, it will return true

function canUpdateValue (field: Number): Boolean;
Returns
Boolean
Parameters
field - Number. required.
Note
When start user editing in the corresponding cell in grid view, it will check the value returned from this function first.
In GridDataSet class, it will return true if row and field are within the range. Please consider DataField.updatable value.
Code -1
    $('#update').click(function () {
        // Update if the first field of the focused row is updatable.
        var rowIndex = grid.focusedRow().dataIndex();
        if (dataset.canUpdateValue(rowIndex, 0)) {
            dataset.setValue(rowIndex, 0, 'value1');
        }
    });
See Also
canAppendRow
canInsertRow
canDeleteRow
canUpdateRow
updatable
Examples
Grid Data Set Edit
Row Upadting