SMART datagrid v.1 > Classes > GridDataSet
DataLudi.GridDataSet.getRowObjects method
Return the value of data rows which are contained in the range specified by startRow and count as array of JSON objects.
If no corresponding row, it will return an empty array. In order to get the value of each row as array, you can call getRows.
function getRowObjects (startRow: Integer, count: Integer, emptyValue: *): [Object];
- Returns
- [Object]
- Parameters
- startRow - Integer. Defaults to 0.
It gets rows as much as count parameter from which have been specified in this property.
If do not specify, it will get from the first row.
If specify an array in which contains row numbers, it will return the object of specified rows. v 1.3.8
In this case, count parameter will be ignored.
- count - Integer. Defaults to -1.
The number of rows which will be imported.
If do not specify or the value is less than 0, it will get from startRow row to the last row.
- emptyValue - *.
The value which will replace undefined field value.
If specify the default data type value like String, it will be applied to all fields,
and if specify JSON object, it will replace by finding the value matching field name. v 1.3.8
- Note
- Like other methods, you must not update Date object which is returned from DATETIME field.
Code -1
var rows = ds.getRowObjects(0, 100, '');
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
for (var c in row) {
console.log(row[c]);
}
}
Code -2
// Get all rows.
var rows = ds.getRowObjects();
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
...
}
Code -3
// Transfer row number list to the first parameter.
var rows = ds.getRowObjects([0, 1, 2, 3], null, '');
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
...
}
- See Also
- getRowObject
- getRowProps
- getRowsProps
- getRows
- getRow
- Examples
- Grid Data Set Rows