SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.canUpdateRow  method

Return true if can update the data row in row location. 

function canUpdateRow (row: Number): Boolean;
Returns
Boolean
Parameters
row - Number. required.
Note
When start user editing in grid view, it will check the value returned from this function first.
In GridDataSet class, it always returns true if row is within the range.
Code -1
    $('#update').click(function () {
        // In grid, it updates the first field of the focused row.
        var rowIndex = grid.focusedRow().dataIndex();
        if (dataset.canUpdateRow(rowIndex)) {
            ds.updateRow(rowIndex, {
                addr: $('#addr').val(),
                salary: $('#salary').val(),
                name: $('#name').val()
            }, true);
        }
    });
See Also
canAppendRow
canInsertRow
canDeleteRow
canUpdateValue
Examples
Grid Data Set Edit
Row Upadting