SMART datagrid v.1 > Classes > TreeDataSet
It creates JSON array which contains properties corresponding to data set fields and can contain the array of child objects as specified property name as tree data rows, and insert in index location of parent row specified by parent.
In order to append to the end of parent row, it will use appendJsonRows. Please refer to setJsonRows about the way of organizing the tree by using parameters.
var rows = [{
loan_number: 'IBRD00010',
country: 'Spain',
interest_rate: 4.25,
currency: 'USD',
...
rows: [{
loan_number: 'IBRD00030',
country: 'Denmark',
...
}, {
loan_number: 'IBRD00040',
country: 'Luxembourg',
...
}]
}];
var row = treeMain.focusedDataRow();
if (row) {
var p = row.parent();
dsMain.insertJsonRows(p, row.index(), rows, "", "rows");
}