SMART datagrid v.1 > Classes > TreeDataSet
将包含相当于数据组字段的属性并可以通过指定的属性名称而包含子对象的JSON数组创建为树数据行之后,将其添加到通过parent而指定的父行的最后。
为插入在中间位置,将会使用insertJsonRows。 有关通过使用参数而构成树的方法,请参考setJsonRows。
// 如同下列调用。
ds.insertJsonRows(parent, parent.count(), rows, rowsProp, childRowsProp, currency);
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 = tree.focusedDataRow();
if (row) {
ds.appendJsonRows(row, rows, "", "rows");
tree.expand(tree.focusedRow());
row = row.getChild(row.count() - 1);
row = tree.getRowOfDataRow(row);
tree.expand(row, true);
tree.setFocusedRow(row);
}