SMART datagrid v.1 > Classes > GridBase

Back  Forward

DataLudi.GridBase.setValueAt  method

Change the value of field specified by field of Grid Row specified by parameter rowIndex

In rowIndex, you can directly specify GridRow object. In field, you can specify the field name, field index or Column Object

function setValueAt (rowIndex: Integer, field: Integer|String|GridColumn, newValue: *);
Returns
Void
Parameters
rowIndex - Integer. required.
field - Integer|String|GridColumn. required.
newValue - *. required.
Code -1
    $('#checkValue').click(function () {
        var row = grid.focusedDataRow();
        if (row) {
            var v = grid.getValueAt(row.index(), 'fldSalary');
            if (v < 3000) {
                grid.setValueAt(row.index(), 'fldSalary', 3000);
            }
        }
    });
See Also
getValueAt
setCellValue
focusedDataRow
GridRow
DataColumn