SMART datagrid v.1 > Classes > GridDataSet

Back  Forward

DataLudi.GridDataSet.updateRows  method

It is used when update one or more consecutive rows at the same time. 

Update with the values of one or more rows which have been transferred by rows array from the data row of the location specified by rows. From the start row among rows, it will be applied as much as the number of "count". The values of each row of rows can be JSON object or 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 by comparing the value of values with the existing field value. If strictDiff is true, it will compare with DataField.equalValues, sameValues

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

If rowEvents is true, it will update individually, and onStateChanged, onRowUpdated events will be fired individually. If it is false, onStatesChanged, onRowsUpdated events will be fired in order after committing all updates. 

function updateRows (row: Integer, rows: Array, start: Number, count: Number, checkDiff: Boolean, strictDiff: Boolean, checkEmpty: Boolean, rowEvents: Boolean);
Returns
Void
Parameters
row - Integer. required.
rows - Array. required.
start - Number. Defaults to 0.
count - Number. Defaults to -1.
checkDiff - Boolean. Defaults to false.
strictDiff - Boolean. Defaults to false.
checkEmpty - Boolean. Defaults to false.
rowEvents - Boolean. Defaults to false.
If it is true, confirmation and completion events will be fired in row unit. If it is DataSet.undoable, events in row unit will not be fired regardless of this property.
Code -1
    ds.onRowsUpdated = function (ds, row, count) {
        alert('It has been updated successfully.');
    };
    
    $('btnUpdate').click(function (ev) {
        var row = grid.focusedDataRow();
        if (row) {
            var rows = ds.getRows(row, 10);
            ds.updateRows(row.dataIndex(), row, 0, 10, true, false);
        }
    });
See Also
onStatesChanged
onRowsUpdated
onStateChanged
onRowUpdated
updateRow
setValue
Examples
Row Updating