SMART datagrid v.1 > Classes > TreeDataSet
It creates JSON array which contains properties corresponding to data set fields and the array of child objects as the property specified by childRowsProp as tree data rows, removes existing rows and adds them.
rows do not have to be an array, only need to have an array which is used as original data set exists in the location specified by rowsProp. If rowsProp is a value as null which has not been specified, rows must be an array. In the table below, it has listed the way of reading rowsProp.
path | Explanation |
---|---|
'' | If do not specify or it is an empty string, it will read the original data as array. |
'row' | It reads 'row' property of original data as array. |
'prop.row' | It reads 'row' property of 'prop' property of original data as array. |
'prop[1].row' | 'prop' property of original data is an array, and it reads 'row' property of this second object as array. |
'$[0].row' | The original data is an array, and it reads 'row' property of this first object as array. |
var rows = [{
loan_number: 'IBRD00010',
country: 'Spain',
interest_rate: 4.25,
currency: 'USD',
...
children: [{
loan_number: 'IBRD00030',
country: 'Denmark',
...
}, {
loan_number: 'IBRD00040',
country: 'Luxembourg',
...
}]
}];
ds.setRows(rows, "", "children", false);