SMART datagrid v.1 > Classes > TreeDataSet

Back  Forward

DataLudi.TreeDataSet.updateRow  method

It updates field values of data row which has been specified by parameter row with values which have been transferred by values

row can specify TreeDataRow object or rowIdvalues can be JSON object or an array of which field names are property. 

If checkDiff is true, it will update the row only when one or more field values are different after comparing the value of values and the existing field value. If strictDiff is true, it will compare with DataField.equalValues or sameValues

If checkEmpty is true, the field value which is undefined among values will not be reflected. 

If the row has been updated actually, the State will be changed as UPDATED and it will return true. Else, it will return false. In addition, just before changing, onRowUpdating event will be fired, and just after changing, onRowUpdated event will be fired. 

function updateRow (row: TreeDataRow|Integer, values: Array, checkDiff: Boolean, strictDiff: Boolean, checkEmpty: Boolean): Boolean;
Returns
Boolean
Parameters
row - TreeDataRow|Integer. required.
values - Array. required.
checkDiff - Boolean. Defaults to false.
strictDiff - Boolean. Defaults to false.
checkEmpty - Boolean. Defaults to false.
Note
Code -1
    $('#updateValue').click(function () {
        var row = tree.focusedRow();
        if (row) {
            var vals = row.dataRow().getObject();
            vals['value'] = $('#value').val();
            dataset.updateRow(row.dataRow(), vals, true);
        }
    });
See Also
onRowUpdating
onRowUpdated
insertRow
deleteRow
TreeDataRow
Tree Overview
Examples
Tree Data Set
Hello Tree