SMART datagrid v.1 > Classes > TreeDataSet
DataLudi.TreeDataSet.getRowObjects method
It returns the value of rows which have been specified by rows as the array of JSON object of which field names are property.
function getRowObjects (rows: [Integer|TreeDataRow], emptyValue: *, all: Boolean): [Object];
- Returns
- [Object]
- Parameters
- rows - [Integer|TreeDataRow]. required.
The
Object of data row or the array of row
ID which will get the value.
- emptyValue - *.
The value which will replace the 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 search and replace with the value of matching field name.
- all - Boolean. Defaults to false.
If it is true, when the item of rows does not specify a valid data row, it will contain null in the returned array.
- Note
- Like other methods, you should not update Date object which is returned from DATETIME field.
Code -1
var rows = tree.getSelectedDataRows();
var objs = ds.getRowObjects(rows);
console.log(objs);
Code -2
var rows = tree.getSelectedDataRows();
// Replace the value of undefined field with 0.
var objs = ds.getRowObjects(rows, 0);
console.log(objs);
Code -3
var rows = tree.getSelectedDataRows();
// Replace the value of undefined fields with the corresponding property value of JSON object.
var objs = ds.getRowObjects(rows, {
name: '',
qty: 0
});
console.log(objs);
- See Also
- getRowsProps
- getRowObject
- getRowProps
- Examples
- Tree Rows