SMART datagrid v.1 > Classes > TreeDataSet

Back  Forward

DataLudi.TreeDataSet.setValue  method

It changes the value of field which has been specified by field of data row. 

You can specify field index or field name in field

function setValue (row: Integer|TreeDataRow, field: Integer|String, value: *);
Returns
Void
Parameters
row - Integer|TreeDataRow. required.
rowId of TreeDataRow object or data row.
field - Integer|String. required.
The field index or field name.
value - *. required.
The value of matching dataType of the specified field.
Code -1
    var index = tree.focusedIndex();
    if (index.isDataCell(tree)) {
        var value = $('#salary').val();
        ds.setValue(index.getDataIndex(tree), index.getDataField(), value);
    }
See Also
getValue
GridBase.focusedIndex
CellIndex.getDataIndex
Examples
Tree Data Set