SMART datagrid v.1 > Classes > GridDataSet
Append original data of one or more data rows which are transferred by rows array after the last row of data set, and return the number of rows which have been actually appended. The data of each row which is contained in rows can be array or JSON object, and JSON object will be arranged and stored as array according to field order.
// If rowEvents is false, the event will be fired when appending of all rows is committed.
ds.onRowsInserted = function (ds, row, count) {
console.log(row + '' + count + ' row has been appended in th row location.';
};
// If rowEvents is true, the event will be fired whenever each row is appended.
ds.onRowInserted = function (ds, row) {
console.log(row + 'One row has been appended in th row location.';
};
// Each row which is transferred by function can be array or JSON object.
var rows = [
['value1', 'value2', 'value3', 111, 222],
{
'field1': 'value11',
'field2': 'value12',
'field3': 'value13',
'field4': 666,
'field5': 777
}
];
// If the count is -1, it will append all rows of rows, and if it is greater than 0, it will append as much as Math.min(count, rows.length).
ds.appendRows(rows, 0, -1, false);