SMART datagrid v.1 > Classes > TreeDataSet
将包含相当于数据组字段的属性并可以通过指定的属性名称而包含子对象的JSON数组创建为树数据行之后, 将其插入在通过parent而指定的父行的index位置。
为添加到父行的最后,将会使用appendJsonRows。 有关通过使用参数而构成树的方法,请参考setJsonRows。
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");
}